wordpress - WP_Post object to string conversion error, when register custom post type -
seen bunch or responses talk post id, , menus... brand new blog. building plugin, when register custom post type error...
catchable fatal error: object of class wp_post not converted string in /wp-includes/formatting.php on line 1280
register_post_type('car_post', array( 'labels' => array( 'name' => 'car content' ), 'singular_label' => 'car content', 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'show_in_menu' => 'car-post', 'rewrite' => array("slug" => "car_post"), 'supports' => array( 'title', 'editor', 'author', 'revisions', 'comments' ) ) );
anyone have idea on possibly causing that? if comment out custom post block... no errors thrown.
custom post types registered way.
<?php add_action( 'init', 'my_post_type' ); function my_post_type() { register_post_type('car_post', array( 'labels' => array( 'name' => 'car content' ), 'singular_label' => 'car content', 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'show_in_menu' => 'car-post', 'rewrite' => array("slug" => "car_post"), 'supports' => array( 'title', 'editor', 'author', 'revisions', 'comments' ) ) ); } ?>
Comments
Post a Comment