Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/bootstrap/CommandFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class CommandFeature
{
protected $config = [];
protected $config = array();

public function __construct()
{
Expand Down
4 changes: 2 additions & 2 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class FeatureContext extends CommandFeature implements Context
{
private $result = [];
private $result = array();

private $importsPath = '';
private $exportsPath = '';
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion features/bootstrap/config/config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$config = [];
$config = array();
$config['wordpress_path'] = str_replace('features/bootstrap/config', '', dirname(__FILE__)).'wordpress/';
$config['wp-cli_path'] = $config['wordpress_path'].'wp-cli.phar';

Expand Down
10 changes: 5 additions & 5 deletions lib/acfwpcli.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ACFWPCLI {

private $added_groups = [];
private $added_groups = array();

public function __construct() {
$this->register_cli_command();
Expand All @@ -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 ) ) {
Expand All @@ -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 ) {
Expand Down
14 changes: 7 additions & 7 deletions lib/acfwpcli/cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) ) {
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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'; }
Expand Down Expand Up @@ -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;
Expand All @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions lib/acfwpcli/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class Field {

public static function import( $field, $field_group ) {
$order = [];
$order = array();

// add parent
if ( empty( $field['parent'] ) ) {
Expand All @@ -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 ) {
Expand Down
4 changes: 2 additions & 2 deletions lib/acfwpcli/field_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down