Support » Plugin: User Submitted Posts » Custom Post type not showing

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help. Currently the plugin only supports WP Posts and Pages. In the next version of the plugin, I will add a filter hook that can be used to add any Custom Post Type(s). Thank you for the feedback.

    Thread Starter Education Guide Administrator

    (@educationguideonline)

    Thank you very much. I just uninstalled that plugin due to lack of this feature. I am now waiting for your next update.

    Thread Starter Education Guide Administrator

    (@educationguideonline)

    Sir, I am still waiting for Custom Post Type availability. I am eagerly waiting sir.

    Plugin Author Jeff Starr

    (@specialk)

    Was added two versions ago. The hook is named usp_post_type, which can be used to filter the post type. You will need to add your own code to do the filtering.

    Thread Starter Education Guide Administrator

    (@educationguideonline)

    Can you please provide me with a sample code? I am not expert in PHP.

    Plugin Author Jeff Starr

    (@specialk)

    Add this to functions.php:

    function usp_modify_post_type($post_type) { 
    	return 'post'; // edit post type as needed
    }
    add_filter('usp_post_type', 'usp_modify_post_type');

    Then change the post type (where it says “edit post type as needed”) to whatever you want.

    Hey.. I just saw this.. and am trying to do this myself…

    Just so I am clear since I don’t really know a lot of coding, am I updating what is after the $ above?? So, if I have a custom post type called “Case_Studies“, would I change the above code to:

    function usp_modify_post_type($Case_Studies) {
    return ‘post’; // edit post type as needed
    }
    add_filter(‘usp_post_type’, ‘usp_modify_post_type’);

    Do I have that correct?

    Thanks.

    Michael

    Plugin Author Jeff Starr

    (@specialk)

    Hey, actually no the // edit post type as needed is on the same line that needs to be edited. So you want to edit the post only. Change it to Case_Studies and you should be good.

    • This reply was modified 2 years, 10 months ago by Jeff Starr. Reason: clarity
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Custom Post type not showing’ is closed to new replies.