@@ -5,7 +5,8 @@ discard block |
||
| 5 | 5 | * |
| 6 | 6 | * @return mixed |
| 7 | 7 | */ |
| 8 | -function pollux_get_post_meta( $metaKey, array $args = [] ) { |
|
| 8 | +function pollux_get_post_meta( $metaKey, array $args = [] ) |
|
| 9 | +{ |
|
| 9 | 10 | return \GeminiLabs\Pollux\Facades\PostMeta::get( $metaKey, $args ); |
| 10 | 11 | } |
| 11 | 12 | |
@@ -14,6 +15,7 @@ discard block |
||
| 14 | 15 | * |
| 15 | 16 | * @return mixed |
| 16 | 17 | */ |
| 17 | -function pollux_get_option( $group, $key = false, $fallback = '' ) { |
|
| 18 | +function pollux_get_option( $group, $key = false, $fallback = '' ) |
|
| 19 | +{ |
|
| 18 | 20 | return \GeminiLabs\Pollux\Facades\SiteMeta::get( $group, $key, $fallback ); |
| 19 | 21 | } |
@@ -13,9 +13,13 @@ |
||
| 13 | 13 | ]; |
| 14 | 14 | foreach( $namespaces as $prefix => $base_dir ) { |
| 15 | 15 | $len = strlen( $prefix ); |
| 16 | - if( strncmp( $prefix, $class, $len ) !== 0 )continue; |
|
| 16 | + if( strncmp( $prefix, $class, $len ) !== 0 ) { |
|
| 17 | + continue; |
|
| 18 | + } |
|
| 17 | 19 | $file = $base_dir . str_replace( '\\', '/', substr( $class, $len ) ) . '.php'; |
| 18 | - if( !file_exists( $file ) )continue; |
|
| 20 | + if( !file_exists( $file ) ) { |
|
| 21 | + continue; |
|
| 22 | + } |
|
| 19 | 23 | require $file; |
| 20 | 24 | break; |
| 21 | 25 | } |
@@ -31,7 +31,8 @@ |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | private function __clone() |
| 34 | - {} |
|
| 34 | + { |
|
| 35 | +} |
|
| 35 | 36 | |
| 36 | 37 | /** |
| 37 | 38 | * Get or create the singleton alias loader instance. |
@@ -31,7 +31,8 @@ |
||
| 31 | 31 | 'name' => 'Plugin Name', |
| 32 | 32 | 'version' => 'Version', |
| 33 | 33 | ), 'plugin' ); |
| 34 | - array_walk( $data, function( $value, $key ) { |
|
| 34 | + array_walk( $data, function( $value, $key ) |
|
| 35 | + { |
|
| 35 | 36 | $this->$key = $value; |
| 36 | 37 | }); |
| 37 | 38 | } |
@@ -14,7 +14,9 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function __construct( $plugin ) |
| 16 | 16 | { |
| 17 | - if( $this->proceed() )return; |
|
| 17 | + if( $this->proceed() ) { |
|
| 18 | + return; |
|
| 19 | + } |
|
| 18 | 20 | |
| 19 | 21 | $this->plugin = $plugin; |
| 20 | 22 | |
@@ -66,7 +66,9 @@ |
||
| 66 | 66 | trailingslashit( dirname( dirname( ABSPATH ))), |
| 67 | 67 | ]); |
| 68 | 68 | foreach( (array) $configLocations as $location ) { |
| 69 | - if( !file_exists( $location . $configYaml ))continue; |
|
| 69 | + if( !file_exists( $location . $configYaml )) { |
|
| 70 | + continue; |
|
| 71 | + } |
|
| 70 | 72 | return $location . $configYaml; |
| 71 | 73 | } |
| 72 | 74 | return $this->app->path( 'defaults.yml' ); |
@@ -18,7 +18,8 @@ |
||
| 18 | 18 | { |
| 19 | 19 | foreach( $this->types as $type => $args ) { |
| 20 | 20 | add_action( "manage_{$type}_posts_custom_column", [$this, 'printColumnValue'], 10, 2 ); |
| 21 | - add_filter( "manage_{$type}_posts_columns", function( $columns ) use( $args ) { |
|
| 21 | + add_filter( "manage_{$type}_posts_columns", function( $columns ) use( $args ) |
|
| 22 | + { |
|
| 22 | 23 | return count( $args['columns'] ) > 1 |
| 23 | 24 | ? $args['columns'] |
| 24 | 25 | : $columns; |
@@ -62,7 +62,8 @@ |
||
| 62 | 62 | $this->types, |
| 63 | 63 | get_post_types( ['_builtin' => true] ) |
| 64 | 64 | ); |
| 65 | - array_walk( $types, function( $args, $type ) { |
|
| 65 | + array_walk( $types, function( $args, $type ) |
|
| 66 | + { |
|
| 66 | 67 | register_post_type( $type, array_diff_key( $args, array_flip( static::CUSTOM_KEYS ))); |
| 67 | 68 | }); |
| 68 | 69 | } |
@@ -48,10 +48,14 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function filterByTaxonomy( WP_Query $query ) |
| 50 | 50 | { |
| 51 | - if( !is_admin() || ( new Helper )->getCurrentScreen()->base != 'edit' )return; |
|
| 51 | + if( !is_admin() || ( new Helper )->getCurrentScreen()->base != 'edit' ) { |
|
| 52 | + return; |
|
| 53 | + } |
|
| 52 | 54 | $vars = &$query->query_vars; |
| 53 | 55 | foreach( array_keys( $this->taxonomies ) as $taxonomy ) { |
| 54 | - if( !isset( $vars[$taxonomy] ))return; |
|
| 56 | + if( !isset( $vars[$taxonomy] )) { |
|
| 57 | + return; |
|
| 58 | + } |
|
| 55 | 59 | if( $term = get_term_by( 'id', $vars[$taxonomy], $taxonomy )) { |
| 56 | 60 | $vars[$taxonomy] = $term->slug; |
| 57 | 61 | } |
@@ -67,7 +71,9 @@ discard block |
||
| 67 | 71 | { |
| 68 | 72 | global $wp_query; |
| 69 | 73 | foreach( $this->taxonomies as $taxonomy => $args ) { |
| 70 | - if( !in_array( get_current_screen()->post_type, $args['post_types'] ))continue; |
|
| 74 | + if( !in_array( get_current_screen()->post_type, $args['post_types'] )) { |
|
| 75 | + continue; |
|
| 76 | + } |
|
| 71 | 77 | $selected = isset( $wp_query->query[$taxonomy] ) |
| 72 | 78 | ? $wp_query->query[$taxonomy] |
| 73 | 79 | : false; |
@@ -88,7 +94,8 @@ discard block |
||
| 88 | 94 | */ |
| 89 | 95 | public function register() |
| 90 | 96 | { |
| 91 | - array_walk( $this->taxonomies, function( $args, $taxonomy ) { |
|
| 97 | + array_walk( $this->taxonomies, function( $args, $taxonomy ) |
|
| 98 | + { |
|
| 92 | 99 | register_taxonomy( $taxonomy, $args['post_types'], array_diff_key( $args, array_flip( static::CUSTOM_KEYS ))); |
| 93 | 100 | foreach( $args['post_types'] as $type ) { |
| 94 | 101 | register_taxonomy_for_object_type( $taxonomy, $type ); |