• DickRaney

    (@dickraney)


    I saw on another support thread that the plugin will only get public post types

    $args = array(
    'public' => true,
    '_builtin' => false
    );

    $post_types = get_post_types( $args );

    I have a custom post type that is private. It shows as an option in settings for ‘Post types to apply’ but two problems:
    1) The button will only appear if I add a shortcode
    2) The PDF just says “no results”

    Is that because it is a private post type? Is there a way to make it work for private post types too?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dinamiko

    (@dinamiko)

    Hello @dickraney,

    By default “Post types to apply” only shows public post types. Regarding “custom post type that is private” do you mean that the post has visibility private or that the custom post type is private? if the later, can you give me an idea how are you registering the private post type? which values do you have for public and publicly_queryable ?

    Also are you using a customized PDF template? thanks!

    Thread Starter DickRaney

    (@dickraney)

    Here is how the post type is registered

    $labels = array(
    'name' => _x('Artist', 'post type general name'),
    'singular_name' => _x('Artist', 'post type singular name'),
    'add_new' => _x('Add New', 'Artist'),
    'add_new_item' => __('Add New Artist'),
    'edit_item' => __('Edit Artist'),
    'new_item' => __('New Artist'),
    'view_item' => __('View Artist'),
    'search_items' => __('Search Artist'),
    'not_found' => __('No Artist found'),
    'not_found_in_trash' => __('No Artist found in Trash'),
    'parent_item_colon' => '',
    'menu_name' => 'Artist'
    );
    $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'query_var' => true,
    'rewrite' => true,
    'capability_type' => 'post',
    'has_archive' => false,
    'hierarchical' => false, // 'false' acts like posts 'true' acts like pages
    'menu_position' => 20,
    'supports' => array('title','editor','custom-fields','thumbnail'),

    );
    register_post_type('artist',$args); // name used in query

    We have not setup any kind of PDF template in DK PDF.

    Plugin Author dinamiko

    (@dinamiko)

    I’ve tried registering the custom post type with the data you provided, in my case the PDF button appears correctly (no shortcode needed) and it is rendering the post content correctly in PDF.

    It seems that could be something else (maybe the theme or a plugin) it’s difficult for me to understand what could be the reason… I suggest (if possible) that you give it a try by temporarily switching to a default WordPress theme, if issue persist them try temporarily deactivate plugins to see if any is causing that behavior.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Private Custom Post Type’ is closed to new replies.