@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function filterWordPressFooter( $text ) |
| 27 | 27 | { |
| 28 | - if( $this->app->config['remove_wordpress_footer'] )return; |
|
| 28 | + if( $this->app->config[ 'remove_wordpress_footer' ] )return; |
|
| 29 | 29 | return $text; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -36,30 +36,30 @@ discard block |
||
| 36 | 36 | public function registerAssets() |
| 37 | 37 | { |
| 38 | 38 | $screenId = ( new Helper )->getCurrentScreen()->id; |
| 39 | - if( $screenId == sprintf( 'toplevel_page_%s', apply_filters( 'pollux/archive/option', Archive::ID ))) { |
|
| 40 | - wp_enqueue_script('editor-expand'); |
|
| 39 | + if( $screenId == sprintf( 'toplevel_page_%s', apply_filters( 'pollux/archive/option', Archive::ID ) ) ) { |
|
| 40 | + wp_enqueue_script( 'editor-expand' ); |
|
| 41 | 41 | if( wp_is_mobile() ) { |
| 42 | 42 | wp_enqueue_script( 'jquery-touch-punch' ); |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | - if( screenId == sprintf( 'toplevel_page_%s', apply_filters( 'pollux/settings/option', Settings::ID ))) { |
|
| 45 | + if( screenId == sprintf( 'toplevel_page_%s', apply_filters( 'pollux/settings/option', Settings::ID ) ) ) { |
|
| 46 | 46 | wp_enqueue_script( 'common' ); |
| 47 | 47 | wp_enqueue_script( 'wp-lists' ); |
| 48 | 48 | wp_enqueue_script( 'postbox' ); |
| 49 | 49 | } |
| 50 | 50 | wp_enqueue_style( 'pollux/main.css', |
| 51 | 51 | $this->app->url( 'assets/main.css' ), |
| 52 | - apply_filters( 'pollux/enqueue/css/deps', [] ), |
|
| 52 | + apply_filters( 'pollux/enqueue/css/deps', [ ] ), |
|
| 53 | 53 | $this->app->version |
| 54 | 54 | ); |
| 55 | 55 | wp_enqueue_script( 'pollux/main.js', |
| 56 | 56 | $this->app->url( 'assets/main.js' ), |
| 57 | - apply_filters( 'pollux/enqueue/js/deps', [] ), |
|
| 57 | + apply_filters( 'pollux/enqueue/js/deps', [ ] ), |
|
| 58 | 58 | $this->app->version |
| 59 | 59 | ); |
| 60 | 60 | wp_localize_script( 'pollux/main.js', |
| 61 | 61 | apply_filters( 'pollux/enqueue/js/localize/name', $this->app->id ), |
| 62 | - apply_filters( 'pollux/enqueue/js/localize/variables', [] ) |
|
| 62 | + apply_filters( 'pollux/enqueue/js/localize/variables', [ ] ) |
|
| 63 | 63 | ); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function removeDashboardWidgets() |
| 71 | 71 | { |
| 72 | - if( !$this->app->config['remove_dashboard_widgets'] )return; |
|
| 72 | + if( !$this->app->config[ 'remove_dashboard_widgets' ] )return; |
|
| 73 | 73 | $widgets = apply_filters( 'pollux/dashoard/widgets', [ |
| 74 | 74 | 'dashboard_primary', |
| 75 | 75 | 'dashboard_quick_press', |
| 76 | - ]); |
|
| 76 | + ] ); |
|
| 77 | 77 | foreach( $widgets as $widget ) { |
| 78 | 78 | remove_meta_box( $widget, 'dashboard', 'normal' ); |
| 79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function removeWordPressMenu() |
| 87 | 87 | { |
| 88 | - if( !$this->app->config['remove_wordpress_menu'] )return; |
|
| 88 | + if( !$this->app->config[ 'remove_wordpress_menu' ] )return; |
|
| 89 | 89 | global $wp_admin_bar; |
| 90 | 90 | $wp_admin_bar->remove_menu( 'wp-logo' ); |
| 91 | 91 | } |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // $this->normalize( $this->app->config['archives'] ); |
| 28 | 28 | |
| 29 | - add_action( 'admin_menu', [$this, 'addPage'] ); |
|
| 30 | - add_action( 'pollux/archive/editor', [$this, 'renderEditor'] ); |
|
| 29 | + add_action( 'admin_menu', [ $this, 'addPage' ] ); |
|
| 30 | + add_action( 'pollux/archive/editor', [ $this, 'renderEditor' ] ); |
|
| 31 | 31 | // add_action( 'pollux/settings/init', [$this, 'addSubmitMetaBox'] ); |
| 32 | 32 | // add_action( 'current_screen', [$this, 'register'] ); |
| 33 | 33 | // add_action( 'admin_menu', [$this, 'registerSetting'] ); |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | __( 'Archive Page', 'pollux' ), |
| 49 | 49 | 'edit_theme_options', |
| 50 | 50 | $this->id, |
| 51 | - [$this, 'renderPage'], |
|
| 51 | + [ $this, 'renderPage' ], |
|
| 52 | 52 | 'dashicons-screenoptions', |
| 53 | 53 | 1310 |
| 54 | - ])); |
|
| 54 | + ] ) ); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | 'columns' => get_current_screen()->get_columns(), |
| 65 | 65 | 'id' => $this->id, |
| 66 | 66 | 'title' => __( 'Archive Page', 'pollux' ), |
| 67 | - ]); |
|
| 67 | + ] ); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -83,6 +83,6 @@ discard block |
||
| 83 | 83 | 'wp_autoresize_on' => true, |
| 84 | 84 | 'add_unload_trigger' => false, |
| 85 | 85 | ], |
| 86 | - ]); |
|
| 86 | + ] ); |
|
| 87 | 87 | } |
| 88 | 88 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * @var string |
| 14 | 14 | */ |
| 15 | - CONST ID = 'pollux_archives'; |
|
| 15 | + const ID = 'pollux_archives'; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * {@inheritdoc} |
@@ -15,10 +15,10 @@ discard block |
||
| 15 | 15 | public function get( $group = null, $key = null, $fallback = null ) |
| 16 | 16 | { |
| 17 | 17 | $options = $this->getOption(); |
| 18 | - if( empty( $options )) { |
|
| 18 | + if( empty( $options ) ) { |
|
| 19 | 19 | return $fallback; |
| 20 | 20 | } |
| 21 | - if( !is_string( $group )) { |
|
| 21 | + if( !is_string( $group ) ) { |
|
| 22 | 22 | return $options; |
| 23 | 23 | } |
| 24 | 24 | $group = $this->normalize( $options, $group, $fallback ); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getOption() |
| 34 | 34 | { |
| 35 | - return get_option( apply_filters( 'pollux/settings/option', Settings::ID ), [] ); |
|
| 35 | + return get_option( apply_filters( 'pollux/settings/option', Settings::ID ), [ ] ); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function normalize( array $options, $key, $fallback ) |
| 44 | 44 | { |
| 45 | - if( !array_key_exists( $key, $options )) { |
|
| 45 | + if( !array_key_exists( $key, $options ) ) { |
|
| 46 | 46 | return $fallback; |
| 47 | 47 | } |
| 48 | - $option = $options[$key]; |
|
| 48 | + $option = $options[ $key ]; |
|
| 49 | 49 | $option = is_array( $option ) |
| 50 | 50 | ? array_filter( $option ) |
| 51 | 51 | : trim( $option ); |
@@ -12,6 +12,6 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | protected function getOption() |
| 14 | 14 | { |
| 15 | - return get_option( apply_filters( 'pollux/archive/option', Archive::ID ), [] ); |
|
| 15 | + return get_option( apply_filters( 'pollux/archive/option', Archive::ID ), [ ] ); |
|
| 16 | 16 | } |
| 17 | 17 | } |