@@ -23,7 +23,9 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function init() |
| 25 | 25 | { |
| 26 | - if( !$this->app->config['disable_posts'] )return; |
|
| 26 | + if( !$this->app->config['disable_posts'] ) { |
|
| 27 | + return; |
|
| 28 | + } |
|
| 27 | 29 | |
| 28 | 30 | add_action( 'init', [$this, 'disable'] ); |
| 29 | 31 | add_action( 'wp_dashboard_setup', [$this, 'modifyDashboardWidgets'] ); |
@@ -43,7 +45,9 @@ discard block |
||
| 43 | 45 | { |
| 44 | 46 | if( !in_array(( new Helper )->getCurrentScreen()->pagenow, [ |
| 45 | 47 | 'edit.php', 'edit-tags.php', 'post-new.php', |
| 46 | - ]))return; |
|
| 48 | + ])) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 47 | 51 | |
| 48 | 52 | if( !filter_input_array( INPUT_GET, [ |
| 49 | 53 | 'post_type' => FILTER_DEFAULT, |
@@ -95,12 +99,17 @@ discard block |
||
| 95 | 99 | */ |
| 96 | 100 | public function modifyDashboardWidgets() |
| 97 | 101 | { |
| 98 | - if( !is_blog_admin() || !current_user_can( 'edit_posts' ))return; |
|
| 102 | + if( !is_blog_admin() || !current_user_can( 'edit_posts' )) { |
|
| 103 | + return; |
|
| 104 | + } |
|
| 99 | 105 | |
| 100 | 106 | global $wp_meta_boxes; |
| 101 | 107 | $widgets = &$wp_meta_boxes['dashboard']['normal']['core']; |
| 102 | - if( !isset( $widgets['dashboard_right_now']['callback'] ))return; |
|
| 103 | - $widgets['dashboard_right_now']['callback'] = function() { |
|
| 108 | + if( !isset( $widgets['dashboard_right_now']['callback'] )) { |
|
| 109 | + return; |
|
| 110 | + } |
|
| 111 | + $widgets['dashboard_right_now']['callback'] = function() |
|
| 112 | + { |
|
| 104 | 113 | ob_start(); |
| 105 | 114 | wp_dashboard_right_now(); |
| 106 | 115 | echo preg_replace( '/<li class="post-count">(.*?)<\/li>/', '', ob_get_clean() ); |
@@ -26,7 +26,9 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function filterWordPressFooter( $text ) |
| 28 | 28 | { |
| 29 | - if( $this->app->config['remove_wordpress_footer'] )return; |
|
| 29 | + if( $this->app->config['remove_wordpress_footer'] ) { |
|
| 30 | + return; |
|
| 31 | + } |
|
| 30 | 32 | return $text; |
| 31 | 33 | } |
| 32 | 34 | |
@@ -63,7 +65,9 @@ discard block |
||
| 63 | 65 | */ |
| 64 | 66 | public function removeDashboardWidgets() |
| 65 | 67 | { |
| 66 | - if( !$this->app->config['remove_dashboard_widgets'] )return; |
|
| 68 | + if( !$this->app->config['remove_dashboard_widgets'] ) { |
|
| 69 | + return; |
|
| 70 | + } |
|
| 67 | 71 | $widgets = apply_filters( 'pollux/dashoard/widgets', [ |
| 68 | 72 | 'dashboard_quick_press', |
| 69 | 73 | ]); |
@@ -78,7 +82,9 @@ discard block |
||
| 78 | 82 | */ |
| 79 | 83 | public function removeWordPressMenu() |
| 80 | 84 | { |
| 81 | - if( !$this->app->config['remove_wordpress_menu'] )return; |
|
| 85 | + if( !$this->app->config['remove_wordpress_menu'] ) { |
|
| 86 | + return; |
|
| 87 | + } |
|
| 82 | 88 | global $wp_admin_bar; |
| 83 | 89 | $wp_admin_bar->remove_menu( 'wp-logo' ); |
| 84 | 90 | } |