| @@ -21,19 +21,19 @@ discard block | ||
| 21 | 21 | * @return string Displays a list of all games. | 
| 22 | 22 | */ | 
| 23 | 23 |  function shortcode( $atts ) { | 
| 24 | - $atts = shortcode_atts([ | |
| 24 | + $atts = shortcode_atts( [ | |
| 25 | 25 | 'gc_game' => '', | 
| 26 | 26 | ], $atts ); | 
| 27 | 27 | |
| 28 | 28 | // Get the ID from the atts, if one was set, so we can get a single game (or all games). | 
| 29 | -	if ( '' === $atts['gc_game'] ) { | |
| 30 | - $post_ids = []; | |
| 31 | -	} elseif ( is_array( $atts['gc_game'] ) ) { | |
| 32 | - $post_ids = $atts['gc_game']; | |
| 33 | -	} elseif ( false !== strpos( (string) $atts['gc_game'], ',' ) ) { | |
| 34 | - $post_ids = explode( ',', $atts['gc_game'] ); | |
| 35 | -	} elseif ( ! is_array( $atts['gc_game'] ) ) { | |
| 36 | - $post_ids = [ $atts['gc_game'] ]; | |
| 29 | +	if ( '' === $atts[ 'gc_game' ] ) { | |
| 30 | + $post_ids = [ ]; | |
| 31 | +	} elseif ( is_array( $atts[ 'gc_game' ] ) ) { | |
| 32 | + $post_ids = $atts[ 'gc_game' ]; | |
| 33 | +	} elseif ( false !== strpos( (string) $atts[ 'gc_game' ], ',' ) ) { | |
| 34 | + $post_ids = explode( ',', $atts[ 'gc_game' ] ); | |
| 35 | +	} elseif ( ! is_array( $atts[ 'gc_game' ] ) ) { | |
| 36 | + $post_ids = [ $atts[ 'gc_game' ] ]; | |
| 37 | 37 | } | 
| 38 | 38 | |
| 39 | 39 | $games = get_games( $post_ids ); | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 | <div <?php post_class( Game\get_game_classes( 'game-single', $game->ID ), $game->ID ); ?> id="game-<?php echo absint( $game->ID ); ?>"> | 
| 52 | 52 | |
| 53 | 53 | <?php | 
| 54 | - echo Display\get_game_title( $game ); // WPCS: XSS ok, already sanitized. | |
| 54 | + echo Display\get_game_title( $game ); // WPCS: XSS ok, already sanitized. | |
| 55 | 55 | echo Display\get_game_info( $game->ID ); // WPCS: XSS ok, already sanitized. | 
| 56 | 56 | ?> | 
| 57 | 57 | |
| @@ -70,31 +70,31 @@ discard block | ||
| 70 | 70 | * @param array $post_ids An array of game post IDs. | 
| 71 | 71 | * @return array An array of Game WP_Post objects. | 
| 72 | 72 | */ | 
| 73 | -function get_games( $post_ids = [] ) { | |
| 73 | +function get_games( $post_ids = [ ] ) { | |
| 74 | 74 |  	if ( empty( $post_ids ) ) { | 
| 75 | 75 | $post_ids = false; | 
| 76 | 76 | } | 
| 77 | 77 | |
| 78 | 78 |  	if ( $post_ids ) { | 
| 79 | 79 | // If we're only displaying select games, don't show the filters. | 
| 80 | - add_filter( 'gc_filter_buttons', '__return_null' ); | |
| 80 | + add_filter( 'gc_filter_buttons', '__return_null' ); | |
| 81 | 81 | add_filter( 'gc_filter_game_filters', '__return_null' ); | 
| 82 | 82 | |
| 83 | - return get_posts([ | |
| 83 | + return get_posts( [ | |
| 84 | 84 | 'posts_per_page' => count( $post_ids ), | 
| 85 | 85 | 'post_type' => 'gc_game', | 
| 86 | 86 | 'post__in' => $post_ids, | 
| 87 | 87 | 'orderby' => 'title', | 
| 88 | 88 | 'order' => 'ASC', | 
| 89 | - ]); | |
| 89 | + ] ); | |
| 90 | 90 | } | 
| 91 | 91 | |
| 92 | - return get_posts([ | |
| 92 | + return get_posts( [ | |
| 93 | 93 | 'posts_per_page' => -1, | 
| 94 | 94 | 'post_type' => 'gc_game', | 
| 95 | 95 | 'orderby' => 'title', | 
| 96 | 96 | 'order' => 'ASC', | 
| 97 | - ]); | |
| 97 | + ] ); | |
| 98 | 98 | } | 
| 99 | 99 | |
| 100 | 100 | /** | 
| @@ -90,7 +90,7 @@ discard block | ||
| 90 | 90 | * @return string All the games in formatted HTML. | 
| 91 | 91 | */ | 
| 92 | 92 |  function gc_get_games() { | 
| 93 | - return Shortcode\shortcode( [] ); | |
| 93 | + return Shortcode\shortcode( [ ] ); | |
| 94 | 94 | } | 
| 95 | 95 | |
| 96 | 96 | /** | 
| @@ -99,7 +99,7 @@ discard block | ||
| 99 | 99 | * @since 0.2 | 
| 100 | 100 | */ | 
| 101 | 101 |  function gc_the_games() { | 
| 102 | - echo Shortcode\shortcode( [] ); // WPCS: XSS ok. Already sanitized. | |
| 102 | + echo Shortcode\shortcode( [ ] ); // WPCS: XSS ok. Already sanitized. | |
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | 105 | /** | 
| @@ -14,17 +14,17 @@ discard block | ||
| 14 | 14 | */ | 
| 15 | 15 |  function bootstrap() { | 
| 16 | 16 | // Add all your plugin hooks here. | 
| 17 | - add_action( 'cmb2_init', __NAMESPACE__ . '\\Game\\fields' ); | |
| 18 | - add_action( 'init', __NAMESPACE__ . '\\Game\\register_cpt' ); | |
| 19 | - add_action( 'init', __NAMESPACE__ . '\\Attributes\\register_taxonomy' ); | |
| 20 | - add_action( 'admin_init', __NAMESPACE__ . '\\Attributes\\create_default_attributes' ); | |
| 21 | - add_action( 'add_meta_boxes', __NAMESPACE__ . '\\Attributes\\metabox' ); | |
| 22 | - add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\\Attributes\\enqueue_scripts' ); | |
| 23 | - add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\Display\\enqueue_scripts' ); | |
| 24 | - add_action( 'register_shortcode_ui', __NAMESPACE__ . '\\Shortcode\\register_all_games_shortcode' ); | |
| 25 | - add_action( 'register_shortcode_ui', __NAMESPACE__ . '\\Shortcode\\register_individual_games_shortcode' ); | |
| 26 | - add_filter( 'rest_prepare_gc_game', __NAMESPACE__ . '\\Api\\filter_games_json', 10, 2 ); | |
| 27 | - add_shortcode( 'games-collector', __NAMESPACE__ . '\\Shortcode\\shortcode' ); | |
| 17 | + add_action( 'cmb2_init', __NAMESPACE__ . '\\Game\\fields' ); | |
| 18 | + add_action( 'init', __NAMESPACE__ . '\\Game\\register_cpt' ); | |
| 19 | + add_action( 'init', __NAMESPACE__ . '\\Attributes\\register_taxonomy' ); | |
| 20 | + add_action( 'admin_init', __NAMESPACE__ . '\\Attributes\\create_default_attributes' ); | |
| 21 | + add_action( 'add_meta_boxes', __NAMESPACE__ . '\\Attributes\\metabox' ); | |
| 22 | + add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\\Attributes\\enqueue_scripts' ); | |
| 23 | + add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\Display\\enqueue_scripts' ); | |
| 24 | + add_action( 'register_shortcode_ui', __NAMESPACE__ . '\\Shortcode\\register_all_games_shortcode' ); | |
| 25 | + add_action( 'register_shortcode_ui', __NAMESPACE__ . '\\Shortcode\\register_individual_games_shortcode' ); | |
| 26 | + add_filter( 'rest_prepare_gc_game', __NAMESPACE__ . '\\Api\\filter_games_json', 10, 2 ); | |
| 27 | + add_shortcode( 'games-collector', __NAMESPACE__ . '\\Shortcode\\shortcode' ); | |
| 28 | 28 | add_shortcode( 'games-collector-list', __NAMESPACE__ . '\\Shortcode\\shortcode' ); | 
| 29 | 29 | } | 
| 30 | 30 | |
| @@ -36,7 +36,7 @@ discard block | ||
| 36 | 36 | */ | 
| 37 | 37 |  function activate() { | 
| 38 | 38 |  	if ( ! get_page_by_title( esc_html__( 'Games', 'games-collector' ) ) ) { | 
| 39 | - $post_id = wp_insert_post([ | |
| 39 | + $post_id = wp_insert_post( [ | |
| 40 | 40 | 'post_type' => 'page', | 
| 41 | 41 | 'post_title' => esc_html__( 'Games', 'games-collector' ), | 
| 42 | 42 | 'post_content' => '[games-collector]', | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | ], | 
| 50 | 50 | ], | 
| 51 | 51 | // Dropdown filters. | 
| 52 | - 'admin_filters' => [], | |
| 52 | + 'admin_filters' => [ ], | |
| 53 | 53 | ], [ | 
| 54 | 54 | 'singular' => __( 'Game', 'games-collector' ), | 
| 55 | 55 | 'plural' => __( 'Games', 'games-collector' ), | 
| @@ -70,9 +70,9 @@ discard block | ||
| 70 | 70 | 'id' => $prefix . 'metabox', | 
| 71 | 71 | 'title' => __( 'Game Details', 'games-collector' ), | 
| 72 | 72 | 'object_types' => [ 'gc_game' ], | 
| 73 | - ]); | |
| 73 | + ] ); | |
| 74 | 74 | |
| 75 | - $cmb->add_field([ | |
| 75 | + $cmb->add_field( [ | |
| 76 | 76 | 'name' => __( 'Minimum Number of Players', 'games-collector' ), | 
| 77 | 77 | 'id' => $prefix . 'min_players', | 
| 78 | 78 | 'type' => 'text_small', | 
| @@ -80,9 +80,9 @@ discard block | ||
| 80 | 80 | 'type' => 'number', | 
| 81 | 81 | 'placeholder' => '1', | 
| 82 | 82 | ], | 
| 83 | - ]); | |
| 83 | + ] ); | |
| 84 | 84 | |
| 85 | - $cmb->add_field([ | |
| 85 | + $cmb->add_field( [ | |
| 86 | 86 | 'name' => __( 'Maximum Number of Players', 'games-collector' ), | 
| 87 | 87 | 'id' => $prefix . 'max_players', | 
| 88 | 88 | 'type' => 'text_small', | 
| @@ -90,9 +90,9 @@ discard block | ||
| 90 | 90 | 'type' => 'number', | 
| 91 | 91 | 'placeholder' => '4', | 
| 92 | 92 | ], | 
| 93 | - ]); | |
| 93 | + ] ); | |
| 94 | 94 | |
| 95 | - $cmb->add_field([ | |
| 95 | + $cmb->add_field( [ | |
| 96 | 96 | 'name' => __( 'Playing Time', 'games-collector' ), | 
| 97 | 97 | 'id' => $prefix . 'time', | 
| 98 | 98 | 'type' => 'text_small', | 
| @@ -100,9 +100,9 @@ discard block | ||
| 100 | 100 | 'attributes' => [ | 
| 101 | 101 | 'placeholder' => '20-30', | 
| 102 | 102 | ], | 
| 103 | - ]); | |
| 103 | + ] ); | |
| 104 | 104 | |
| 105 | - $cmb->add_field([ | |
| 105 | + $cmb->add_field( [ | |
| 106 | 106 | 'name' => __( 'Ages', 'games-collector' ), | 
| 107 | 107 | 'id' => $prefix . 'age', | 
| 108 | 108 | 'type' => 'text_small', | 
| @@ -111,16 +111,16 @@ discard block | ||
| 111 | 111 | 'type' => 'number', | 
| 112 | 112 | 'placeholder' => '10', | 
| 113 | 113 | ], | 
| 114 | - ]); | |
| 114 | + ] ); | |
| 115 | 115 | |
| 116 | - $cmb->add_field([ | |
| 116 | + $cmb->add_field( [ | |
| 117 | 117 | 'name' => __( 'Difficulty Level', 'games-collector' ), | 
| 118 | 118 | 'id' => $prefix . 'difficulty', | 
| 119 | 119 | 'type' => 'radio', | 
| 120 | 120 | 'desc' => __( 'How difficult or complex is this game?', 'games-collector' ), | 
| 121 | 121 | 'options' => get_difficulties(), | 
| 122 | 122 | 'default' => 'easy', | 
| 123 | - ]); | |
| 123 | + ] ); | |
| 124 | 124 | |
| 125 | 125 | $cmb->add_field( array( | 
| 126 | 126 | 'name' => __( 'More Info Link', 'games-collector' ), | 
| @@ -148,8 +148,8 @@ discard block | ||
| 148 | 148 | |
| 149 | 149 | $players_min_max = get_players_min_max( $post_id ); | 
| 150 | 150 | |
| 151 | -	if ( isset( $players_min_max['min'] ) && isset( $players_min_max['max'] ) ) { | |
| 152 | - return sprintf( '%1$s - %2$s', $players_min_max['min'], $players_min_max['max'] ); | |
| 151 | +	if ( isset( $players_min_max[ 'min' ] ) && isset( $players_min_max[ 'max' ] ) ) { | |
| 152 | + return sprintf( '%1$s - %2$s', $players_min_max[ 'min' ], $players_min_max[ 'max' ] ); | |
| 153 | 153 | } | 
| 154 | 154 | |
| 155 | 155 | return; | 
| @@ -291,20 +291,20 @@ discard block | ||
| 291 | 291 | $difficulty = get_post_meta( $post_id, '_gc_difficulty', true ); | 
| 292 | 292 | $length = get_game_length( $post_id ); | 
| 293 | 293 | |
| 294 | -	if ( isset( $players['min'] ) ) { | |
| 295 | - $classes .= ' min-' . $players['min'] . '-players'; | |
| 294 | +	if ( isset( $players[ 'min' ] ) ) { | |
| 295 | + $classes .= ' min-' . $players[ 'min' ] . '-players'; | |
| 296 | 296 | } | 
| 297 | 297 | |
| 298 | -	if ( isset( $players['max'] ) ) { | |
| 299 | -		if ( absint( $players['max'] ) >= 8 ) { | |
| 298 | +	if ( isset( $players[ 'max' ] ) ) { | |
| 299 | +		if ( absint( $players[ 'max' ] ) >= 8 ) { | |
| 300 | 300 | $classes .= ' 8-or-more-players'; | 
| 301 | 301 |  		} else { | 
| 302 | - $classes .= ' max-' . $players['max'] . '-players'; | |
| 302 | + $classes .= ' max-' . $players[ 'max' ] . '-players'; | |
| 303 | 303 | } | 
| 304 | 304 | } | 
| 305 | 305 | |
| 306 | -	if ( isset( $players['min'] ) && ! isset( $players['max'] ) ) { | |
| 307 | - $classes .= ' ' . $players['min'] . '-players'; | |
| 306 | +	if ( isset( $players[ 'min' ] ) && ! isset( $players[ 'max' ] ) ) { | |
| 307 | + $classes .= ' ' . $players[ 'min' ] . '-players'; | |
| 308 | 308 | } | 
| 309 | 309 | |
| 310 | 310 |  	if ( $age ) { | 
| @@ -340,7 +340,7 @@ discard block | ||
| 340 | 340 | |
| 341 | 341 | $game_time = str_replace( ' ', '', get_post_meta( $post_id, '_gc_time', true ) ); | 
| 342 | 342 | $time = explode( '-', $game_time ); | 
| 343 | - $time = isset( $time[1] ) ? $time[1] : $time[0]; | |
| 343 | + $time = isset( $time[ 1 ] ) ? $time[ 1 ] : $time[ 0 ]; | |
| 344 | 344 | |
| 345 | 345 |  	if ( $game_time ) { | 
| 346 | 346 |  		switch ( $time ) { | 
| @@ -28,27 +28,27 @@ | ||
| 28 | 28 | $link = get_post_meta( $post->ID, '_gc_link' ); | 
| 29 | 29 | |
| 30 | 30 |  	if ( $min_players ) { | 
| 31 | - $data->data['min_players'] = $min_players; | |
| 31 | + $data->data[ 'min_players' ] = $min_players; | |
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | 34 |  	if ( $max_players ) { | 
| 35 | - $data->data['max_players'] = $max_players; | |
| 35 | + $data->data[ 'max_players' ] = $max_players; | |
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 |  	if ( $time ) { | 
| 39 | - $data->data['time'] = $time; | |
| 39 | + $data->data[ 'time' ] = $time; | |
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | 42 |  	if ( $age ) { | 
| 43 | - $data->data['age'] = $age; | |
| 43 | + $data->data[ 'age' ] = $age; | |
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | 46 |  	if ( $difficulty ) { | 
| 47 | - $data->data['difficulty'] = $difficulty; | |
| 47 | + $data->data[ 'difficulty' ] = $difficulty; | |
| 48 | 48 | } | 
| 49 | 49 | |
| 50 | 50 |  	if ( $link ) { | 
| 51 | - $data->data['url'] = $link; | |
| 51 | + $data->data[ 'url' ] = $link; | |
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | 54 | return $data; | 
| @@ -61,11 +61,11 @@ discard block | ||
| 61 | 61 | |
| 62 | 62 | <div class="game-info" id="game-<?php echo absint( $game_id ); ?>-info"> | 
| 63 | 63 | <?php | 
| 64 | - echo get_players( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 64 | + echo get_players( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 65 | 65 | echo get_playing_time( $game_id ); // WPCS: XSS ok, already sanitized. | 
| 66 | - echo get_age( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 67 | - echo get_difficulty( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 68 | - echo get_attributes( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 66 | + echo get_age( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 67 | + echo get_difficulty( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 68 | + echo get_attributes( $game_id ); // WPCS: XSS ok, already sanitized. | |
| 69 | 69 | ?> | 
| 70 | 70 | </div> | 
| 71 | 71 | |
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | * @return string Select markup for filters. | 
| 160 | 160 | */ | 
| 161 | 161 |  function get_filters() { | 
| 162 | - $player_filter = '<div class="player-filter"><label for="players-filter-select">' . esc_html__( 'How many players?', 'games-collector' ) . ':</label> | |
| 162 | + $player_filter = '<div class="player-filter"><label for="players-filter-select">' . esc_html__( 'How many players?', 'games-collector' ) . ':</label> | |
| 163 | 163 | <select class="players-filter-select"> | 
| 164 | 164 | <option selected>- ' . esc_html__( 'Select one', 'games-collector' ) . ' -</option> | 
| 165 | 165 | <option value=".2-players,.min-2-players,.max-2-players,.max-3-players,.max-4-players,.max-5-players,.max-6-players,.max-7-players,.8-or-more-players">' . esc_html__( '2+ players', 'games-collector' ) . '</option> | 
| @@ -229,7 +229,7 @@ discard block | ||
| 229 | 229 | $attribute_list = Attributes\get_the_attribute_list( | 
| 230 | 230 | $game_id, | 
| 231 | 231 | '<div class="game-attributes"><span class="gc-icon icon-game-attributes">' . get_svg( 'tags', false ) . '</span><span class="game-attributes" id="game-' . absint( $game_id ) . '-attributes">', // Before. | 
| 232 | - ', ', // Seperator. | |
| 232 | + ', ', // Seperator. | |
| 233 | 233 | '</span></div>' // After. | 
| 234 | 234 | ); | 
| 235 | 235 | |
| @@ -254,14 +254,14 @@ discard block | ||
| 254 | 254 |  function get_players( $game_id ) { | 
| 255 | 255 | $players_min_max = Game\get_players_min_max( $game_id ); | 
| 256 | 256 | |
| 257 | -	if ( isset( $players_min_max['min'] ) ) { | |
| 257 | +	if ( isset( $players_min_max[ 'min' ] ) ) { | |
| 258 | 258 | ob_start(); ?> | 
| 259 | 259 | |
| 260 | 260 | <span class="gc-icon icon-game-players"><?php the_svg( 'players', false ); ?></span><span class="game-num-players" id="game-<?php echo absint( $game_id ); ?>-num-players"><?php echo esc_attr( sprintf( | 
| 261 | 261 | // Translators: 1: Minimum number of players, 2: Maximum number of players. | 
| 262 | 262 | __( '%1$d %2$s players', 'games-collector' ), | 
| 263 | - absint( $players_min_max['min'] ), | |
| 264 | - isset( $players_min_max['max'] ) ? sprintf( '- %d', absint( $players_min_max['max'] ) ) : '+' | |
| 263 | + absint( $players_min_max[ 'min' ] ), | |
| 264 | + isset( $players_min_max[ 'max' ] ) ? sprintf( '- %d', absint( $players_min_max[ 'max' ] ) ) : '+' | |
| 265 | 265 | ) ); ?></span><?php | 
| 266 | 266 | |
| 267 | 267 | $output = ob_get_clean(); | 
| @@ -370,7 +370,7 @@ discard block | ||
| 370 | 370 | return; | 
| 371 | 371 | } | 
| 372 | 372 | |
| 373 | - wp_enqueue_style( 'games-collector', dirname( dirname( plugin_dir_url( __FILE__ ) ) ) . '/assets/css/games-collector.css', [], '1.1.0-r2' ); | |
| 373 | + wp_enqueue_style( 'games-collector', dirname( dirname( plugin_dir_url( __FILE__ ) ) ) . '/assets/css/games-collector.css', [ ], '1.1.0-r2' ); | |
| 374 | 374 | wp_enqueue_script( 'isotope', dirname( dirname( plugin_dir_url( __FILE__ ) ) ) . '/assets/js/isotope.pkgd.min.js', [ 'jquery' ], '3.0.1', true ); | 
| 375 | 375 | wp_enqueue_script( 'games-collector', dirname( dirname( plugin_dir_url( __FILE__ ) ) ) . '/assets/js/games-collector.js', [ 'jquery', 'isotope' ], '0.2' ); | 
| 376 | 376 | } | 
| @@ -55,7 +55,7 @@ | ||
| 55 | 55 | // Autoload the namespaces. | 
| 56 | 56 | $namespaces = array_filter( glob( dirname( __FILE__ ) . '/inc/*' ), 'is_dir' ); | 
| 57 | 57 |  	foreach ( $namespaces as $namespace ) { | 
| 58 | - $files[] = $namespace . '/namespace.php'; | |
| 58 | + $files[ ] = $namespace . '/namespace.php'; | |
| 59 | 59 | } | 
| 60 | 60 | |
| 61 | 61 | // Loop through and load all the things! | 
| @@ -16,7 +16,7 @@ discard block | ||
| 16 | 16 | */ | 
| 17 | 17 |  function register_taxonomy() { | 
| 18 | 18 | register_extended_taxonomy( 'gc_attribute', 'gc_game', [ | 
| 19 | - 'dashboard_glance' => true, // Show this taxonomy in the 'At a Glance' widget. | |
| 19 | + 'dashboard_glance' => true, // Show this taxonomy in the 'At a Glance' widget. | |
| 20 | 20 | 'hierarchical' => false, | 
| 21 | 21 | 'show_in_rest' => true, | 
| 22 | 22 | 'rest_base' => 'attributes', | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | 53 | wp_enqueue_script( 'chosen', plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'vendor/chosen-js/chosen.jquery.js', [ 'jquery' ], '1.6.2', true ); | 
| 54 | - wp_enqueue_style( 'chosen', plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'vendor/chosen-js/chosen.css', [], '1.6.2' ); | |
| 54 | + wp_enqueue_style( 'chosen', plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'vendor/chosen-js/chosen.css', [ ], '1.6.2' ); | |
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 | /** | 
| @@ -184,7 +184,7 @@ discard block | ||
| 184 | 184 | */ | 
| 185 | 185 |  function save_post( $post_id ) { | 
| 186 | 186 | // Verify nonce. | 
| 187 | -	if ( ! isset( $_POST['chosen_taxonomy_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['chosen_taxonomy_meta_box_nonce'], 'chosen-save-tax-terms' ) ) { | |
| 187 | +	if ( ! isset( $_POST[ 'chosen_taxonomy_meta_box_nonce' ] ) || ! wp_verify_nonce( $_POST[ 'chosen_taxonomy_meta_box_nonce' ], 'chosen-save-tax-terms' ) ) { | |
| 188 | 188 | return; | 
| 189 | 189 | } | 
| 190 | 190 | // Check autosave. | 
| @@ -192,7 +192,7 @@ discard block | ||
| 192 | 192 | return; | 
| 193 | 193 | } | 
| 194 | 194 | |
| 195 | - $input = isset( $_POST['tax_input']['gc_attribute'] ) ? $_POST['tax_input']['gc_attribute'] : ''; | |
| 195 | + $input = isset( $_POST[ 'tax_input' ][ 'gc_attribute' ] ) ? $_POST[ 'tax_input' ][ 'gc_attribute' ] : ''; | |
| 196 | 196 | |
| 197 | 197 |  	if ( empty( $input ) ) { | 
| 198 | 198 | $taxonomy = get_taxonomy( 'gc_attribute' ); | 
| @@ -250,19 +250,19 @@ discard block | ||
| 250 | 250 |  function gc_kses( $string = '' ) { | 
| 251 | 251 | $allowed_html = array_merge( wp_kses_allowed_html( 'post' ), [ | 
| 252 | 252 | 'svg' => [ | 
| 253 | - 'class' => [], | |
| 254 | - 'aria-labelledby' => [], | |
| 255 | - 'role' => [], | |
| 256 | - 'version' => [], | |
| 257 | - 'xmlns' => [], | |
| 258 | - 'xmlns:xlink' => [], | |
| 259 | - 'height' => [], | |
| 260 | - 'width' => [], | |
| 261 | - 'viewbox' => [], | |
| 253 | + 'class' => [ ], | |
| 254 | + 'aria-labelledby' => [ ], | |
| 255 | + 'role' => [ ], | |
| 256 | + 'version' => [ ], | |
| 257 | + 'xmlns' => [ ], | |
| 258 | + 'xmlns:xlink' => [ ], | |
| 259 | + 'height' => [ ], | |
| 260 | + 'width' => [ ], | |
| 261 | + 'viewbox' => [ ], | |
| 262 | 262 | ], | 
| 263 | - 'title' => [], | |
| 263 | + 'title' => [ ], | |
| 264 | 264 | 'path' => [ | 
| 265 | - 'd' => [], | |
| 265 | + 'd' => [ ], | |
| 266 | 266 | ], | 
| 267 | 267 | ] ); | 
| 268 | 268 | |