Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dev.biuro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Biuro
dev.biuro
Commits
2f5f0e7a
Commit
2f5f0e7a
authored
Jan 16, 2019
by
Simonas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in progress Contacts
parent
7c339e5b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
9 deletions
+159
-9
.env
.env
+3
-0
docker-compose.yml
docker-compose.yml
+4
-3
functions.php
wp-content/themes/biuro/functions.php
+65
-0
disable-discussion.php
wp-content/themes/biuro/includes/disable-discussion.php
+50
-0
page-agencies.php
wp-content/themes/biuro/page-agencies.php
+37
-6
No files found.
.env
View file @
2f5f0e7a
...
...
@@ -12,6 +12,9 @@ DB_USERNAME=dev_user
DB_PASSWORD=Y6V6bFkD6@GyD!wTShgFmWz!
DB_ROOT_PASSWORD=q@z!z29AO5rpzMjsDhjnFKyF
UID=1000
GID=1000
NGINX_NAME_LT=dev.biuro.lt
NGINX_NAME_LV=dev.biuro.lv
NGINX_NAME_EE=dev.biuro.ee
docker-compose.yml
View file @
2f5f0e7a
...
...
@@ -86,10 +86,11 @@ services:
wordpress-cli
:
image
:
${IMAGE_WORDPRESS_CLI}
user
:
"
${UID}:${GID}"
container_name
:
"
${PROJECT}-wordpress-cli"
environment
:
-
APACHE_RUN_USER="www-data"
-
APACHE_RUN_GROUP="www-data"
#
environment:
#
- APACHE_RUN_USER="www-data"
#
- APACHE_RUN_GROUP="www-data"
links
:
-
wordpress
-
mysql
...
...
wp-content/themes/biuro/functions.php
View file @
2f5f0e7a
...
...
@@ -236,12 +236,77 @@ function init_biuro_theme() {
add_action
(
'init'
,
'init_biuro_theme'
);
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function
df_disable_comments_post_types_support
()
{
$post_types
=
get_post_types
();
foreach
(
$post_types
as
$post_type
)
{
if
(
post_type_supports
(
$post_type
,
'comments'
))
{
remove_post_type_support
(
$post_type
,
'comments'
);
remove_post_type_support
(
$post_type
,
'trackbacks'
);
}
}
}
add_action
(
'admin_init'
,
'df_disable_comments_post_types_support'
);
// Close comments on the front-end
function
df_disable_comments_status
()
{
return
false
;
}
add_filter
(
'comments_open'
,
'df_disable_comments_status'
,
20
,
2
);
add_filter
(
'pings_open'
,
'df_disable_comments_status'
,
20
,
2
);
// Hide existing comments
function
df_disable_comments_hide_existing_comments
(
$comments
)
{
$comments
=
array
();
return
$comments
;
}
add_filter
(
'comments_array'
,
'df_disable_comments_hide_existing_comments'
,
10
,
2
);
// Remove comments page in menu
function
df_disable_comments_admin_menu
()
{
remove_menu_page
(
'edit-comments.php'
);
}
add_action
(
'admin_menu'
,
'df_disable_comments_admin_menu'
);
// Redirect any user trying to access comments page
function
df_disable_comments_admin_menu_redirect
()
{
global
$pagenow
;
if
(
$pagenow
===
'edit-comments.php'
)
{
wp_redirect
(
admin_url
());
exit
;
}
}
add_action
(
'admin_init'
,
'df_disable_comments_admin_menu_redirect'
);
// Remove comments metabox from dashboard
function
df_disable_comments_dashboard
()
{
remove_meta_box
(
'dashboard_recent_comments'
,
'dashboard'
,
'normal'
);
}
add_action
(
'admin_init'
,
'df_disable_comments_dashboard'
);
// Remove comments links from admin bar
function
df_disable_comments_admin_bar
()
{
if
(
is_admin_bar_showing
())
{
remove_action
(
'admin_bar_menu'
,
'wp_admin_bar_comments_menu'
,
60
);
}
}
add_action
(
'init'
,
'df_disable_comments_admin_bar'
);
$l
=
get_nav_menu_locations
();
$m
=
$l
?
wp_get_nav_menu_object
(
$l
[
'main-menu'
]
)
:
null
;
$items
=
$m
?
wp_get_nav_menu_items
(
$m
->
term_id
,
array
(
'order'
=>
'DESC'
)
)
:
array
();
$searchPageURL
=
$items
[
0
]
?
$items
[
0
]
->
url
:
'/'
;
// require_once 'includes/disable_discussion';
function
getSiteTree
(
$taxonomy
)
{
...
...
wp-content/themes/biuro/includes/disable-discussion.php
0 → 100644
View file @
2f5f0e7a
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function
df_disable_comments_post_types_support
()
{
$post_types
=
get_post_types
();
foreach
(
$post_types
as
$post_type
)
{
if
(
post_type_supports
(
$post_type
,
'comments'
))
{
remove_post_type_support
(
$post_type
,
'comments'
);
remove_post_type_support
(
$post_type
,
'trackbacks'
);
}
}
}
add_action
(
'admin_init'
,
'df_disable_comments_post_types_support'
);
// Close comments on the front-end
function
df_disable_comments_status
()
{
return
false
;
}
add_filter
(
'comments_open'
,
'df_disable_comments_status'
,
20
,
2
);
add_filter
(
'pings_open'
,
'df_disable_comments_status'
,
20
,
2
);
// Hide existing comments
function
df_disable_comments_hide_existing_comments
(
$comments
)
{
$comments
=
array
();
return
$comments
;
}
add_filter
(
'comments_array'
,
'df_disable_comments_hide_existing_comments'
,
10
,
2
);
// Remove comments page in menu
function
df_disable_comments_admin_menu
()
{
remove_menu_page
(
'edit-comments.php'
);
}
add_action
(
'admin_menu'
,
'df_disable_comments_admin_menu'
);
// Redirect any user trying to access comments page
function
df_disable_comments_admin_menu_redirect
()
{
global
$pagenow
;
if
(
$pagenow
===
'edit-comments.php'
)
{
wp_redirect
(
admin_url
());
exit
;
}
}
add_action
(
'admin_init'
,
'df_disable_comments_admin_menu_redirect'
);
// Remove comments metabox from dashboard
function
df_disable_comments_dashboard
()
{
remove_meta_box
(
'dashboard_recent_comments'
,
'dashboard'
,
'normal'
);
}
add_action
(
'admin_init'
,
'df_disable_comments_dashboard'
);
// Remove comments links from admin bar
function
df_disable_comments_admin_bar
()
{
if
(
is_admin_bar_showing
())
{
remove_action
(
'admin_bar_menu'
,
'wp_admin_bar_comments_menu'
,
60
);
}
}
add_action
(
'init'
,
'df_disable_comments_admin_bar'
);
wp-content/themes/biuro/page-agencies.php
View file @
2f5f0e7a
...
...
@@ -12,6 +12,17 @@
* @version 1.0
*/
global
$post
;
$pageID
=
$post
->
ID
;
$related
=
pods
(
'division'
,
$params
)
->
find
(
array
(
'limit'
=>
-
1
,
'where'
=>
"page-id.ID = "
.
$pageID
)
);
$total
=
$related
->
total
();
get_header
();
?>
<?php
...
...
@@ -23,12 +34,17 @@ get_header(); ?>
endwhile
;
?>
<?php
while
(
$related
->
fetch
()
)
:
echo
$related
->
display
(
'content'
);
endwhile
;
?>
<?
$params
=
array
(
'limit'
=>
-
1
);
$divisions
=
pods
(
'division'
,
$params
);
$divisions
=
pods
(
'division'
,
array
(
'limit'
=>
-
1
)
);
if
(
0
<
$divisions
->
total
()
)
:
$cities
=
array
();
...
...
@@ -38,7 +54,7 @@ get_header(); ?>
<?php
if
(
1
<
$divisions
->
total
()
)
:
?>
<li
class=
"js-agency c-agencies--list-item
is-agencies--list-item-active
"
>
Visi
</li>
<li
class=
"js-agency c-agencies--list-item
<?php
if
(
$total
==
0
)
{
echo
'is-agencies--list-item-active'
;
}
?>
"
>
Visi
</li>
<?php
endif
;
...
...
@@ -46,9 +62,24 @@ get_header(); ?>
$slug
=
$divisions
->
display
(
'city.slug'
);
if
(
!
in_array
(
$slug
,
$cities
)
&&
$divisions
->
display
(
'name'
)
)
:
$page
=
$divisions
->
field
(
'page-id'
);
?>
<li
class=
"js-agency c-agencies--list-item
<?php
if
(
$pageID
==
$page
[
'ID'
]
)
{
echo
'is-agencies--list-item-active'
;
}
?>
"
data-id=
"
<?php
echo
$slug
;
?>
"
>
<?php
if
(
!
empty
(
$page
)
)
:
?>
<a
href=
"
<?php
echo
esc_url
(
get_permalink
(
$page
[
'ID'
]
)
);
?>
"
>
<?php
echo
$divisions
->
display
(
'city'
);
?>
</a>
<?
else
:
?>
<li
class=
"js-agency c-agencies--list-item"
data-id=
"
<?php
echo
$slug
;
?>
"
>
<?php
echo
$divisions
->
display
(
'city'
);
?>
</li
>
<?php
echo
$divisions
->
display
(
'city'
);
?
>
<?
endif
;
?>
</li>
<?
array_push
(
$cities
,
$slug
);
endif
;
endwhile
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment