| @@ -113,7 +113,7 @@ | ||
| 113 | 113 |  			foreach ( $users as $user ) { | 
| 114 | 114 | |
| 115 | 115 |  				if ( user_can( $user, 'update_plugins' ) || user_can( $user, 'install_plugins' ) || user_can( $user, 'delete_plugins' ) || user_can( $user, 'edit_theme_options' ) ) { | 
| 116 | - $user_options[ $user->ID ] = $user->display_name; | |
| 116 | + $user_options[$user->ID] = $user->display_name; | |
| 117 | 117 | } | 
| 118 | 118 | } | 
| 119 | 119 | |
| @@ -225,7 +225,7 @@ discard block | ||
| 225 | 225 | $tax_options = array(); | 
| 226 | 226 |  			foreach ( $taxonomies as $taxonomy ) { | 
| 227 | 227 | |
| 228 | - $tax_options[ $taxonomy->name ] = $taxonomy->labels->name; | |
| 228 | + $tax_options[$taxonomy->name] = $taxonomy->labels->name; | |
| 229 | 229 | |
| 230 | 230 | } | 
| 231 | 231 | return $tax_options; | 
| @@ -246,7 +246,7 @@ discard block | ||
| 246 | 246 | |
| 247 | 247 |  			foreach ( $post_type_objects as $post_type_object ) { | 
| 248 | 248 |  				if ( $post_type_object->show_ui && $post_type_object->name !== 'meta_box' ) { | 
| 249 | - $post_types[ $post_type_object->name ] = $post_type_object->label; | |
| 249 | + $post_types[$post_type_object->name] = $post_type_object->label; | |
| 250 | 250 | } | 
| 251 | 251 | } | 
| 252 | 252 | |
| @@ -230,7 +230,7 @@ | ||
| 230 | 230 | * | 
| 231 | 231 | * @since 1.1.4 | 
| 232 | 232 | * @param string $arg Field definition. | 
| 233 | - * @param string|array $value A CMB2 field type. | |
| 233 | + * @param string[] $value A CMB2 field type. | |
| 234 | 234 | */ | 
| 235 | 235 |  		public function add_arg( $arg, $value ) { | 
| 236 | 236 | |
| @@ -83,7 +83,7 @@ discard block | ||
| 83 | 83 | |
| 84 | 84 | $cmb2_settings = get_option( '_cmb2_settings' ); | 
| 85 | 85 | |
| 86 | -			if ( empty( $cmb2_settings ) || current_user_can('administrator')) { | |
| 86 | +			if ( empty( $cmb2_settings ) || current_user_can( 'administrator' ) ) { | |
| 87 | 87 | // No settings saved. | 
| 88 | 88 | return true; | 
| 89 | 89 | } | 
| @@ -107,7 +107,7 @@ discard block | ||
| 107 | 107 | $plugins = $wp_list_table->items; | 
| 108 | 108 |  				foreach ( array_keys( $plugins ) as $key ) { | 
| 109 | 109 |  					if ( in_array( $key, $to_hide, true ) ) { | 
| 110 | - unset( $wp_list_table->items[ $key ] ); | |
| 110 | + unset( $wp_list_table->items[$key] ); | |
| 111 | 111 | } | 
| 112 | 112 | } | 
| 113 | 113 | } | 
| @@ -202,7 +202,7 @@ discard block | ||
| 202 | 202 |  				if ( ! isset( $opt_arr[1] ) ) { | 
| 203 | 203 | continue; | 
| 204 | 204 | } | 
| 205 | - $field_options[ $opt_arr[0] ] = $opt_arr[1]; | |
| 205 | + $field_options[$opt_arr[0]] = $opt_arr[1]; | |
| 206 | 206 | } | 
| 207 | 207 | $this->field_args['options'] = $field_options; | 
| 208 | 208 | } | 
| @@ -215,13 +215,13 @@ discard block | ||
| 215 | 215 | */ | 
| 216 | 216 |  		public function add_strpos_arg( $arg_value ) { | 
| 217 | 217 | |
| 218 | -			if ( strpos( $this->field['_cmb2_field_type_select'], $arg_value[0] ) !== false && isset( $this->field[ $arg_value[2] ] ) && $this->field[ $arg_value[2] ] !== '' ) { | |
| 218 | +			if ( strpos( $this->field['_cmb2_field_type_select'], $arg_value[0] ) !== false && isset( $this->field[$arg_value[2]] ) && $this->field[$arg_value[2]] !== '' ) { | |
| 219 | 219 | |
| 220 | 220 |  				if ( is_array( $arg_value[1] ) ) { | 
| 221 | - $this->field_args[ $arg_value[1][0] ][ $arg_value[1][1] ] = $this->field[ $arg_value[2] ]; | |
| 221 | + $this->field_args[$arg_value[1][0]][$arg_value[1][1]] = $this->field[$arg_value[2]]; | |
| 222 | 222 | return; | 
| 223 | 223 | } | 
| 224 | - $this->field_args[ $arg_value[1] ] = $this->field[ $arg_value[2] ]; | |
| 224 | + $this->field_args[$arg_value[1]] = $this->field[$arg_value[2]]; | |
| 225 | 225 | } | 
| 226 | 226 | } | 
| 227 | 227 | |
| @@ -238,10 +238,10 @@ discard block | ||
| 238 | 238 | |
| 239 | 239 |  				if ( is_array( $value[1] ) ) { | 
| 240 | 240 | |
| 241 | - $this->field_args[ $value[0] ][ $value[1][0] ] = $this->field[ $value[1][1] ]; | |
| 241 | + $this->field_args[$value[0]][$value[1][0]] = $this->field[$value[1][1]]; | |
| 242 | 242 | return; | 
| 243 | 243 | } | 
| 244 | - $this->field_args[ $value[0] ] = $this->field[ $value[1] ]; | |
| 244 | + $this->field_args[$value[0]] = $this->field[$value[1]]; | |
| 245 | 245 | } | 
| 246 | 246 | } | 
| 247 | 247 | |
| @@ -256,7 +256,7 @@ discard block | ||
| 256 | 256 | */ | 
| 257 | 257 |  		static function should_add_arg( $field, $field_type, $field_key ) { | 
| 258 | 258 | |
| 259 | - return ( $field['_cmb2_field_type_select'] === $field_type && ( ! empty( $field[ $field_key ] ) && $field[ $field_key ] !== '' ) ); | |
| 259 | + return ( $field['_cmb2_field_type_select'] === $field_type && ( ! empty( $field[$field_key] ) && $field[$field_key] !== '' ) ); | |
| 260 | 260 | } | 
| 261 | 261 | |
| 262 | 262 | /** | 
| @@ -284,8 +284,8 @@ discard block | ||
| 284 | 284 | $title = get_the_title( $metabox_id ); | 
| 285 | 285 | $id = str_replace( '-', '_', $user_meta_box->post_name ); | 
| 286 | 286 | $post_type = cmbf( $metabox_id, $prefix . 'post_type_multicheckbox' ); | 
| 287 | - $post_id_text = cmbf( $metabox_id, $prefix . 'post_id_text' ); | |
| 288 | -				$show_on 	= explode(',', $post_id_text); | |
| 287 | + $post_id_text = cmbf( $metabox_id, $prefix . 'post_id_text' ); | |
| 288 | + $show_on = explode( ',', $post_id_text ); | |
| 289 | 289 | $context = cmbf( $metabox_id, $prefix . 'context_radio' ); | 
| 290 | 290 | $priority = cmbf( $metabox_id, $prefix . 'priority_radio' ); | 
| 291 | 291 | $show_names = cmbf( $metabox_id, $prefix . 'show_names' ) === 'on' ? true : false; | 
| @@ -296,7 +296,7 @@ discard block | ||
| 296 | 296 | /** | 
| 297 | 297 | * Initiate the metabox. | 
| 298 | 298 | */ | 
| 299 | -				if ($post_id_text !== ''){ | |
| 299 | +				if ( $post_id_text !== '' ) { | |
| 300 | 300 |  				${ 'cmb_' . $id } = new_cmb2_box( array( | 
| 301 | 301 | 'id' => $id, | 
| 302 | 302 | 'title' => $title, | 
| @@ -333,7 +333,7 @@ discard block | ||
| 333 | 333 | ) ); | 
| 334 | 334 | $this->field = $field; | 
| 335 | 335 | $field_id = '_' . strtolower( str_replace( ' ', '_', $field['_cmb2_name_text'] ) ); | 
| 336 | - $this->field_args = array( | |
| 336 | + $this->field_args = array( | |
| 337 | 337 | 'name' => $field['_cmb2_name_text'], | 
| 338 | 338 | 'desc' => $field['_cmb2_decription_textarea'], | 
| 339 | 339 | 'id' => $field_id, | 
| @@ -196,6 +196,7 @@ | ||
| 196 | 196 | * | 
| 197 | 197 | * @param int $id Post ID. | 
| 198 | 198 | * @param string $field The meta key to retrieve. | 
| 199 | + * @return string | |
| 199 | 200 | */ | 
| 200 | 201 |  	function cmbf( $id, $field ) { | 
| 201 | 202 | |