• Resolved Adriana08

    (@adriana08)


    hi there

    I tried to install your plugin into my wordpress. I always receive this error: Parse error: syntax error, unexpected ‘[‘ in /home/www/web152/html/website_artworkpeder/Wordpress/wp-content/plugins/wpgiftregistry/admin/class-wp-gift-registry-admin.php on line 117

    I already updated PHP to 7.1 but I am still not able to install it. Can you help me?

    Thanks and regards
    Adriana

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dreiQBIK

    (@3qbik)

    Hey @adriana08,

    thanks for your message.

    This is usual bracket syntax for arrays which is available since PHP 5.4 – this shouldn’t be the problem. I checked the code again.

    Do you have the following code in wpgiftregistry/admin/class-wp-gift-registry-admin.php for lines 117-146?

    register_post_type('wpgr_wishlist', [
    		  'labels' => [
    		    'name' => __('Wishlist', 'wpgiftregistry'),
    		    'singular_name' => __('Wishlist', 'wpgiftregistry'),
    		    'menu_name' => __('Wishlists', 'wpgiftregistry'),
    		    'add_new_item' => __('Add new Wishlist', 'wpgiftregistry'),
    		    'edit_item' => __('Edit Wishlist', 'wpgiftregistry'),
    		    'new_item' => __('New Wishlist', 'wpgiftregistry'),
    		    'search_items' => __('Search Wishlists', 'wpgiftregistry'),
    		    'all_items' => __('All Wishlists', 'wpgiftregistry'),
    		  ],
    		  'description' => '',
    		  'public' => TRUE,
    		  'publicly_queryable' => TRUE,
    		  'show_ui' => TRUE,
    		  'show_in_rest' => FALSE,
    		  'rest_base' => '',
    		  'has_archive' => FALSE,
    		  'show_in_menu' => TRUE,
    		  'exclude_from_search' => FALSE,
    		  'capability_type' => 'post',
    		  'map_meta_cap' => TRUE,
    		  'hierarchical' => FALSE,
    		  'rewrite' => [
    		    'slug' => 'wishlist',
    		    'with_front' => FALSE
    		  ],
    		  'supports' => ['title', 'author'],
    		  'menu_icon' => plugins_url( "../images/gift_registry_icon.png", __FILE__ ),
    		]);

    If yes, everything should work correctly.

    Best
    Moritz

    Thread Starter Adriana08

    (@adriana08)

    Thanks for your fast feedback. Yes I do have this code.
    What else could be the problem?

    Thanks and regards

    Plugin Author dreiQBIK

    (@3qbik)

    Hey @adriana08,
    are you absolutely sure you are on PHP 7.1? It doesn’t seem like it.

    Try rewriting the code and replace every “[” with “array(” and every “]” with “)”.
    Best
    Moritz

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Still fatal error’ is closed to new replies.