• Resolved greatdee

    (@greatdee)


    syntax error, unexpected token “-“, expecting “(“

    What I’m trying to do is create new taxonomy for already created Custom Post Type. I can’t activate it cause i always get this error. The generated snippet looks like this:

    add_action('init', 'register_tax_freebee-type');
    
    function register_tax_freebee-type() {
      register_taxonomy('freebee-type', array('freebee'), array(
        'labels' => array(
          'name' => _x('Freebee Types', 'Taxonomy General Name', 'freebee-type'),
          'singular_name' => _x('Freebee Type', 'Taxonomy Singular Name', 'freebee-type'),
          'menu_name' => __('Freebee Types', 'freebee-type'),
          'all_items' => __('All Freebee Types', 'freebee-type'),
          'parent_item' => __('Parent Freebee Type', 'freebee-type'),
          'parent_item_colon' => __('Parent Freebee Type:', 'freebee-type'),
          'new_item_name' => __('New Freebee Type', 'freebee-type'),
          'add_new_item' => __('Add New Freebee Type', 'freebee-type'),
          'edit_item' => __('Edit Freebee Type', 'freebee-type'),
          'update_item' => __('Update Freebee Type', 'freebee-type'),
          'view_item' => __('View Freebee Type', 'freebee-type'),
          'separate_items_with_commas' => __('Separate Freebee Types with Commas', 'freebee-type'),
          'add_or_remove_items' => __('Add or Remove Freebee Types', 'freebee-type'),
          'choose_from_most_used' => __('Choose from the Most Used Freebee Types', 'freebee-type'),
          'popular_items' => __('Popular Freebee Types', 'freebee-type'),
          'search_items' => __('Search Freebee Types', 'freebee-type'),
          'not_found' => __('Not Found', 'freebee-type'),
          'no_terms' => __('No Freebee Types', 'freebee-type'),
          'items_list' => __('Freebee Types List', 'freebee-type'),
          'items_list_navigation' => __('Freebee Types List Navigation', 'freebee-type')
        ),
        'hierarchical' => true,
        'public' => true,
        'show_ui' => true,
        'show_admin_column' => true,
        'show_in_nav_menus' => false,
        'show_tagcloud' => false
      ));
    }

    please help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi there,

    Please do not use – in the function name field, only _ can be used.

    Since you already generated the snippet, please use the button at the bottom of the snippet editor page to edit it in the generator form or simply change the function name replacing – with _ in both places.

    Thread Starter greatdee

    (@greatdee)

    ok thank you, it’s working now

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘syntax error in the php snippet generated by the plugin’ is closed to new replies.