Tagged: CPT, custome post type, Fatal error
- This topic has 1 reply, 1 voice, and was last updated 4 years, 9 months ago by
achowell.
Viewing 1 reply thread
-
AuthorPosts
-
-
April 18, 2017 at 2:41 pm #7937
achowellMemberFor some reason, some of my Piklist post types keep crashing my websites if both the plugin that creates the post type and the piklist plugin are on. Below is a simple plugin that creates a post type that breaks the site with the FATAL error if used with Piklist.
<?php //ADD SPOTLIGHT POST TYPE add_filter('piklist_post_types', 'spotlight_videos_post_type'); function spotlight_videos_post_type($post_types) { $post_types['spotlight_videos'] = array( 'labels' => piklist('post_type_labels', 'Spotlight Video') ,'title' => __('Enter a new Spotlight Video') ,'public' => true ,'menu_icon' => 'dashicons-video-alt2' ,'capability_type' => 'spotlight_videos' ,'capabilities' => array( 'publish_posts' => 'publish_spotlight_video' ,'edit_posts' => 'edit_spotlight_video' ,'edit_others_posts' => 'edit_others_spotlight_videos' ,'delete_posts' => 'delete_spotlight_videos' ,'delete_others_posts' => 'delete_others_spotlight_videos' ,'read_private_posts' => 'read_private_spotlight_videos' ,'edit_post' => 'edit_spotlight_video' ,'delete_post' => 'delete_spotlight_video' ,'read_post' => 'read_spotlight_video' ) ,'rewrite' => array( 'slug' => 'spotlight_videos' ) ,map_meta_cap => true ,'supports' => array( 'title' ,'editor' ,'author' ,'revisions' ,'thumbnail' ) ,'hide_meta_box' => array( 'slug' ,'author' ,'revisions' ,'comments' ,'commentstatus' ) ); return $post_types; } ?> -
April 18, 2017 at 2:46 pm #7938
achowellMemberOh never mind I found out what the issue was actually, the meta_map_cap had the wrong “‘” around them that messed up the code! Sorry for the unnecessary topic.
-
-
AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.