@@ -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 | remove_action( 'welcome_panel', 'wp_welcome_panel' ); |
| 29 | 31 | |
@@ -46,7 +48,9 @@ discard block |
||
| 46 | 48 | { |
| 47 | 49 | if( !in_array(( new Helper )->getCurrentScreen()->pagenow, [ |
| 48 | 50 | 'edit.php', 'edit-tags.php', 'post-new.php', |
| 49 | - ]))return; |
|
| 51 | + ])) { |
|
| 52 | + return; |
|
| 53 | + } |
|
| 50 | 54 | |
| 51 | 55 | if( !filter_input_array( INPUT_GET, [ |
| 52 | 56 | 'post_type' => FILTER_DEFAULT, |
@@ -98,12 +102,17 @@ discard block |
||
| 98 | 102 | */ |
| 99 | 103 | public function modifyDashboardWidgets() |
| 100 | 104 | { |
| 101 | - if( !is_blog_admin() || !current_user_can( 'edit_posts' ))return; |
|
| 105 | + if( !is_blog_admin() || !current_user_can( 'edit_posts' )) { |
|
| 106 | + return; |
|
| 107 | + } |
|
| 102 | 108 | |
| 103 | 109 | global $wp_meta_boxes; |
| 104 | 110 | $widgets = &$wp_meta_boxes['dashboard']['normal']['core']; |
| 105 | - if( !isset( $widgets['dashboard_right_now']['callback'] ))return; |
|
| 106 | - $widgets['dashboard_right_now']['callback'] = function() { |
|
| 111 | + if( !isset( $widgets['dashboard_right_now']['callback'] )) { |
|
| 112 | + return; |
|
| 113 | + } |
|
| 114 | + $widgets['dashboard_right_now']['callback'] = function() |
|
| 115 | + { |
|
| 107 | 116 | ob_start(); |
| 108 | 117 | wp_dashboard_right_now(); |
| 109 | 118 | echo preg_replace( '/<li class="post-count">(.*?)<\/li>/', '', ob_get_clean() ); |