Home Forums Plugin Support WP User Frontend Pro Custom post type in dashboard

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Rob 5 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #20867

    Post count: 101


    I have created a custom post type “private_post” and wish to show it on user's the dashboard.

    I use [wpuf_dashboard post_type=”private_post”] , but I only get the normal “post” post-type (ie not “private_post” post type)



    Oritro Ahmed
    Post count: 155

    Hello Rob,

    It seems fine from our end. Nothing wrong with your shortcode. We are Pretty Sure it has something to do with your custom post type.


    Post count: 101

    Thanks, Oritro.

    When I hard code line 74 of class/frontend-dashboard.php as follows, it works OK:
    'post_type' => 'private_post', //$post_type,
    so post_type="private_post" is not being parsed?

    I can't quite see a problem with my custom post type definition:

    /*-- register Private Post Type for counselling ---*/
    if ( ! function_exists('cpt_private_post') ) {
    // Hook into the 'init' action
    add_action( 'init', 'cpt_private_post', 0 );
    // Register Custom Post Type
    function cpt_private_post() {
    	$labels = array(
    		'name'                => _x( 'Private Posts', 'Post Type General Name', 'text_domain' ),
    		'singular_name'       => _x( 'Private Post', 'Post Type Singular Name', 'text_domain' ),
    		'menu_name'           => __( 'Private Post', 'text_domain' ),
    		'parent_item_colon'   => __( 'Parent Private Post:', 'text_domain' ),
    		'all_items'           => __( 'All Private Posts', 'text_domain' ),
    		'view_item'           => __( 'View Private Post', 'text_domain' ),
    		'add_new_item'        => __( 'Add New Private Post', 'text_domain' ),
    		'add_new'             => __( 'Add Private Post', 'text_domain' ),
    		'edit_item'           => __( 'Edit Private Post', 'text_domain' ),
    		'update_item'         => __( 'Update Private Post', 'text_domain' ),
    		'search_items'        => __( 'Search Private Posts', 'text_domain' ),
    		'not_found'           => __( 'Private Post Not found', 'text_domain' ),
    		'not_found_in_trash'  => __( 'Private Post not found in Trash', 'text_domain' ),
    	$args = array(
    		'label'               => __( 'private_post', 'text_domain' ),
    		'description'         => __( 'Private Posts', 'text_domain' ),
    		'labels'              => $labels,
    		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'custom-fields', 'page-attributes', ),
    		'hierarchical'        => false,
    		'public'              => true,
    		'show_ui'             => true,
    		'show_in_menu'        => true,
    		'show_in_nav_menus'   => true,
    		'show_in_admin_bar'   => true,
    		'menu_position'       => 5,
    		'menu_icon'           => 'dashicons-pressthis',
    		'can_export'          => true,
    		'has_archive'         => true,
    		'exclude_from_search' => true,
    		'publicly_queryable'  => true,
    		'capability_type'     => 'post',
    	register_post_type( 'private_post', $args );



    Post count: 101

    I also attach below a table dump csv of a typical custom post.

    1049,1,24/05/2014 14:12,24/05/2014 01:12,"<p style=\color: #666666;\"">The quick", brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.</p>,,,,,,,,
    "<p style=\""color: #666666;\"">Two driven jocks help fax my big quiz. Quick", Baz," get my woven flax jodhpurs! \""Now fax quiz Jack! \"" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job", kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump.</p>,,,,,,,,,,,
    "<p style=\""color: #666666;\"">Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch \""Jeopardy! \""", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show. Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz. Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl. Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels. Sixty zippers were quickly picked from the woven jute bag. A quick check</p>,,,,,,,,,,,,,,,,
    "<p style=\""color: #666666;\""></p>",,,,,,,,,,,,,,,,,,
    "<p style=\""color: #666666;\""></p>""",Test Private post #2,,publish,open,open,,test-private-post-2,,,24/05/2014 15:00,24/05/2014 02:00,,0,http://problemshare.net/?post_type=private_post&p=1049,0,private_post,,0

    Post count: 101


    Oops – I have made an error!

    I was looking at the text editor, and I discovered some formatting within the shortcode. When removed, it worked perfectly.


Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Custom post type in dashboard’ is closed to new replies.