• Hello,

    I woke up today and started getting this error message. I have no idea what this means or what to do. Any ideas on how to fix it? Thanks a lot

    Parse error: syntax error, unexpected ‘list’ (T_LIST), expecting identifier (T_STRING) in /home2/jojoma/fairautobuying.space/wp-content/plugins/astra-sites/inc/classes/class-astra-sites-wp-cli.php on line 63

    The code starting on line 63 is…

    public function list( $args, $assoc_args ) {

    $per_page = isset( $assoc_args[‘per-page’] ) ? $assoc_args[‘per-page’] : 10;
    $search = isset( $assoc_args[‘search’] ) ? $assoc_args[‘search’] : ”;

    $rest_args = array(
    ‘_fields’ => ‘id,title,slug,astra-site-category,astra-site-page-builder,astra-sites-tag,astra-site-type,astra-site-url’,
    ‘per_page’ => $per_page,
    );

    if ( ! empty( $search ) ) {
    $rest_args[‘search’] = $search;
    }

    $list = (array) $this->get_sites( ‘astra-sites’, $rest_args, true, $assoc_args );

    // Modify the output.
    foreach ( $list as $key => $item ) {
    $list[ $key ][‘categories’] = implode( ‘, ‘, $list[ $key ][‘categories’] );
    $list[ $key ][‘page-builder’] = implode( ‘, ‘, $list[ $key ][‘page_builders’] );
    }

    if ( ! empty( $list ) ) {
    $display_fields = array(
    ‘id’,
    ‘title’,
    ‘url’,
    ‘type’,
    ‘categories’,
    ‘page-builder’,
    );
    $formatter = $this->get_formatter( $assoc_args, $display_fields );
    $formatter->display_items( $list );
    } else {
    WP_CLI::error( __( ‘No sites found! Try another query.’, ‘astra-sites’ ) );
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Parse error: syntax error, unexpected ‘list’’ is closed to new replies.