diff --git a/features/bootstrap/CommandFeature.php b/features/bootstrap/CommandFeature.php index 1ff607a..4a9e08d 100644 --- a/features/bootstrap/CommandFeature.php +++ b/features/bootstrap/CommandFeature.php @@ -2,7 +2,7 @@ class CommandFeature { - protected $config = []; + protected $config = array(); public function __construct() { diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index cddbc64..e3b6430 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -11,7 +11,7 @@ */ class FeatureContext extends CommandFeature implements Context { - private $result = []; + private $result = array(); private $importsPath = ''; private $exportsPath = ''; @@ -119,7 +119,7 @@ public function iRemoveTheFieldsFrom($file) $jsonString = file_get_contents($this->exportsPath.$file); $arr = json_decode($jsonString, true); - $arr[0]['fields'] = []; + $arr[0]['fields'] = array(); $fp = fopen($this->exportsPath.$file, 'w'); fwrite($fp, json_encode($arr)); diff --git a/features/bootstrap/config/config.php b/features/bootstrap/config/config.php index 9290671..dcb0961 100644 --- a/features/bootstrap/config/config.php +++ b/features/bootstrap/config/config.php @@ -1,6 +1,6 @@ register_cli_command(); @@ -21,14 +21,14 @@ public function add_runtime_fieldgroups() { $db_field_groups = ACFWPCLI\FieldGroup::all(); - $db_field_group_titles = []; + $db_field_group_titles = array(); foreach ( $db_field_groups as $db_group ) { $db_field_group_titles[] = $db_group->post_title; } - $paths = []; + $paths = array(); $paths = apply_filters( 'acfwpcli_fieldgroup_paths', $paths ); - $patterns = []; + $patterns = array(); foreach ( $paths as $key => $value ) { if ( ! is_dir( $value ) ) { @@ -37,7 +37,7 @@ public function add_runtime_fieldgroups() { $patterns[ $key ] = trailingslashit( $value ) . '*.json'; } - $added_groups = []; + $added_groups = array(); foreach ( $patterns as $pattern ) { // register the field groups specific for this subsite foreach ( glob( $pattern ) as $file ) { diff --git a/lib/acfwpcli/cli.php b/lib/acfwpcli/cli.php index e7e449d..ca79850 100644 --- a/lib/acfwpcli/cli.php +++ b/lib/acfwpcli/cli.php @@ -17,12 +17,12 @@ */ class CLI extends WP_CLI_Command { - private $paths = []; + private $paths = array(); function __construct() { $wpcli_config = WP_CLI::get_config(); - $this->paths = []; + $this->paths = array(); $this->paths = apply_filters( 'acfwpcli_fieldgroup_paths', $this->paths ); if ( is_multisite( ) && ! isset( $wpcli_config['url'] ) ) { @@ -55,7 +55,7 @@ static function help() { function export( $args, $assoc_args ) { extract( $assoc_args ); - $field_groups = []; + $field_groups = array(); if ( isset( $field_group ) ) { $name = sanitize_title( $field_group ); @@ -145,7 +145,7 @@ function import( $args, $assoc_args ) { $choice = $this->menu_choice_import_field_group(); } - $patterns = []; + $patterns = array(); if ( $choice == 'all' ) { foreach ( $this->paths as $key => $value ) { $patterns[ $key ] = trailingslashit( $value ) . '*.json'; } @@ -185,7 +185,7 @@ protected function menu_choice_export_path() { return array_shift( $this->paths ); } - $choices = []; + $choices = array(); foreach ( $this->paths as $key => $value ) { $choices[ $value ] = $key . ': ' . $value; @@ -195,10 +195,10 @@ protected function menu_choice_export_path() { } private function menu_choice_import_field_group() { - $choices = []; + $choices = array(); $choices['all'] = 'all'; - $patterns = []; + $patterns = array(); foreach ( $this->paths as $path ) { $patterns[] = trailingslashit( $path ) . '*.json'; diff --git a/lib/acfwpcli/field.php b/lib/acfwpcli/field.php index 17868e4..9802041 100644 --- a/lib/acfwpcli/field.php +++ b/lib/acfwpcli/field.php @@ -5,7 +5,7 @@ class Field { public static function import( $field, $field_group ) { - $order = []; + $order = array(); // add parent if ( empty( $field['parent'] ) ) { @@ -30,12 +30,12 @@ public static function import( $field, $field_group ) { } public static function all() { - return get_posts([ + return get_posts(array( 'numberposts' => -1, 'post_type' => array( 'acf', 'acf-field' ), 'sort_column' => 'menu_order', 'order' => 'ASC', - ]); + )); } public static function destroy( $id ) { diff --git a/lib/acfwpcli/field_group.php b/lib/acfwpcli/field_group.php index 1dab24d..d3f839e 100644 --- a/lib/acfwpcli/field_group.php +++ b/lib/acfwpcli/field_group.php @@ -33,12 +33,12 @@ public static function import( $file ) { } public static function all() { - return get_posts([ + return get_posts(array( 'numberposts' => -1, 'post_type' => 'acf-field-group', 'sort_column' => 'menu_order', 'order' => 'ASC', - ]); + )); } public static function find_by_name( $name ) {