0

I'm trying to implement a simple php function code, to add some taxonomies to my posts, however I keep running into syntax error on line where 'labels'=>array(, my code is the following:

<?php
/*
Plugin Name: Movie Reviews
Plugin URI: http://wp.tutsplus.com/
Description: Declares a plugin that will create a custom post type displaying movie reviews.
Version: 1.0
Author: Soumitra Chakraborty
Author URI: http://wp.tutsplus.com/
License: GPLv2
*/
?>

<?php
add_action( 'init', 'create_movie_review' );

function create_movie_review() {
    register_post_type( 'movie_reviews',
        array(
            'labels' => array(
                'name' => 'Movie Reviews',
                'singular_name' => 'Movie Review',
                'add_new' => 'Add New',
                'add_new_item' => 'Add New Movie Review',
                'edit' => 'Edit',
                'edit_item' => 'Edit Movie Review',
                'new_item' => 'New Movie Review',
                'view' => 'View',
                'view_item' => 'View Movie Review',
                'search_items' => 'Search Movie Reviews',
                'not_found' => 'No Movie Reviews found',
                'not_found_in_trash' => 'No Movie Reviews found in Trash',
                'parent' => 'Parent Movie Review'
            ),
 
            'public' => true,
            'menu_position' => 15,
            'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields' ),
            'taxonomies' => array( '' ),
            'menu_icon' => plugins_url( 'images/image.png', __FILE__ ),
            'has_archive' => true
        )
    );
}

?>

Can someone please help me?

Raptor
  • 51,208
  • 43
  • 217
  • 353
Jacky Kuk
  • 1
  • 1
  • 2
    what is the exact error message – Kai Qing Oct 29 '13 at 03:55
  • 1
    That doesn't seem to have syntax errors – Hanky Panky Oct 29 '13 at 03:57
  • 1
    The code works for me, no errors. But, get rid of [that last **`?>`**](http://stackoverflow.com/questions/4410704/why-would-one-omit-the-close-tag). – brasofilo Oct 29 '13 at 06:53
  • OKAY guys thanks so much, i got it to work! The problem was I copied this code ONLINE.. maybe the character setting or something has messed up computer's ability to read the code correctly.. i pasted it here and copy again, it worked! – Jacky Kuk Oct 29 '13 at 16:32

0 Answers0