This topic contains 1 reply, has 1 voice, and was last updated by  achowell 1 year, 11 months ago.

  • Author
    Posts
  • #7937

    achowell
    Participant

    For 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;
    }
    ?>
    
  • #7938

    achowell
    Participant

    Oh 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.

You must be logged in to reply to this topic.