@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function filterPluginLinks( array $links ) |
| 29 | 29 | { |
| 30 | - $settings_url = admin_url( sprintf( 'options-general.php?page=%s', $this->app->id )); |
|
| 31 | - $links[] = $this->app->config->disable_config |
|
| 32 | - ? sprintf( '<span class="network_only">%s</span>', __( 'Settings Disabled', 'pollux' )) |
|
| 33 | - : sprintf( '<a href="%s">%s</a>', $settings_url, __( 'Settings', 'pollux' )); |
|
| 30 | + $settings_url = admin_url( sprintf( 'options-general.php?page=%s', $this->app->id ) ); |
|
| 31 | + $links[ ] = $this->app->config->disable_config |
|
| 32 | + ? sprintf( '<span class="network_only">%s</span>', __( 'Settings Disabled', 'pollux' ) ) |
|
| 33 | + : sprintf( '<a href="%s">%s</a>', $settings_url, __( 'Settings', 'pollux' ) ); |
|
| 34 | 34 | return $links; |
| 35 | 35 | } |
| 36 | 36 | |
@@ -59,17 +59,17 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | wp_enqueue_style( 'pollux/main.css', |
| 61 | 61 | $this->app->url( 'assets/main.css' ), |
| 62 | - apply_filters( 'pollux/enqueue/css/deps', [] ), |
|
| 62 | + apply_filters( 'pollux/enqueue/css/deps', [ ] ), |
|
| 63 | 63 | $this->app->version |
| 64 | 64 | ); |
| 65 | 65 | wp_enqueue_script( 'pollux/main.js', |
| 66 | 66 | $this->app->url( 'assets/main.js' ), |
| 67 | - apply_filters( 'pollux/enqueue/js/deps', [] ), |
|
| 67 | + apply_filters( 'pollux/enqueue/js/deps', [ ] ), |
|
| 68 | 68 | $this->app->version |
| 69 | 69 | ); |
| 70 | 70 | wp_localize_script( 'pollux/main.js', |
| 71 | 71 | apply_filters( 'pollux/enqueue/js/localize/name', $this->app->id ), |
| 72 | - ['vars' => apply_filters( 'pollux/enqueue/js/localize/variables', [] )] |
|
| 72 | + [ 'vars' => apply_filters( 'pollux/enqueue/js/localize/variables', [ ] ) ] |
|
| 73 | 73 | ); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $widgets = apply_filters( 'pollux/dashoard/widgets', [ |
| 84 | 84 | 'dashboard_primary', |
| 85 | 85 | 'dashboard_quick_press', |
| 86 | - ]); |
|
| 86 | + ] ); |
|
| 87 | 87 | foreach( $widgets as $widget ) { |
| 88 | 88 | remove_meta_box( $widget, 'dashboard', 'normal' ); |
| 89 | 89 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function registerArchiveAssets( WP_Screen $screen ) |
| 107 | 107 | { |
| 108 | - if(( new Helper )->endsWith( '_archive', $screen->id ) && $screen->pagenow == 'edit.php' ) { |
|
| 108 | + if( ( new Helper )->endsWith( '_archive', $screen->id ) && $screen->pagenow == 'edit.php' ) { |
|
| 109 | 109 | wp_enqueue_script( 'common' ); |
| 110 | 110 | wp_enqueue_script( 'editor-expand' ); |
| 111 | 111 | wp_enqueue_script( 'post' ); |
@@ -125,12 +125,12 @@ discard block |
||
| 125 | 125 | if( $screen->id == 'settings_page_pollux' && $screen->pagenow == 'options-general.php' ) { |
| 126 | 126 | wp_enqueue_style( 'pollux/codemirror.css', |
| 127 | 127 | $this->app->url( 'assets/codemirror.css' ), |
| 128 | - [], |
|
| 128 | + [ ], |
|
| 129 | 129 | $this->app->version |
| 130 | 130 | ); |
| 131 | 131 | wp_enqueue_script( 'pollux/codemirror.js', |
| 132 | 132 | $this->app->url( 'assets/codemirror.js' ), |
| 133 | - ['pollux/main.js'], |
|
| 133 | + [ 'pollux/main.js' ], |
|
| 134 | 134 | $this->app->version |
| 135 | 135 | ); |
| 136 | 136 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | protected function registerSettingsAssets( WP_Screen $screen ) |
| 155 | 155 | { |
| 156 | - if( $screen->id == sprintf( 'toplevel_page_%s', Settings::id() )) { |
|
| 156 | + if( $screen->id == sprintf( 'toplevel_page_%s', Settings::id() ) ) { |
|
| 157 | 157 | wp_enqueue_script( 'common' ); |
| 158 | 158 | wp_enqueue_script( 'postbox' ); |
| 159 | 159 | wp_enqueue_script( 'wp-lists' ); |
@@ -40,7 +40,9 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function filterWordPressFooter( $text ) |
| 42 | 42 | { |
| 43 | - if( $this->app->config->remove_wordpress_footer )return; |
|
| 43 | + if( $this->app->config->remove_wordpress_footer ) { |
|
| 44 | + return; |
|
| 45 | + } |
|
| 44 | 46 | return $text; |
| 45 | 47 | } |
| 46 | 48 | |
@@ -79,7 +81,9 @@ discard block |
||
| 79 | 81 | */ |
| 80 | 82 | public function removeDashboardWidgets() |
| 81 | 83 | { |
| 82 | - if( !$this->app->config->remove_dashboard_widgets )return; |
|
| 84 | + if( !$this->app->config->remove_dashboard_widgets ) { |
|
| 85 | + return; |
|
| 86 | + } |
|
| 83 | 87 | $widgets = apply_filters( 'pollux/dashoard/widgets', [ |
| 84 | 88 | 'dashboard_primary', |
| 85 | 89 | 'dashboard_quick_press', |
@@ -95,7 +99,9 @@ discard block |
||
| 95 | 99 | */ |
| 96 | 100 | public function removeWordPressMenu() |
| 97 | 101 | { |
| 98 | - if( !$this->app->config->remove_wordpress_menu )return; |
|
| 102 | + if( !$this->app->config->remove_wordpress_menu ) { |
|
| 103 | + return; |
|
| 104 | + } |
|
| 99 | 105 | global $wp_admin_bar; |
| 100 | 106 | $wp_admin_bar->remove_menu( 'wp-logo' ); |
| 101 | 107 | } |