WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hello can anybody help me to return "multiple" Custom Post Types in this snippet? I would like to use 3-5 other custom post types and I can't get it work.

The snippet above for ONE custom post type works, the snippet below for multiple custom post types doesn't.

add_filter( 'buddyblog_get_post_type', 'buddyblog_my_post_type' );
function buddyblog_my_post_type( $post_type ) {
    return 'portfolio';

I have tried this and several other snippets without a success:

add_filter( 'buddyblog_get_post_type', 'buddyblog_my_post_type' );
function buddyblog_my_post_type( $array ) {
    $array = array( 'post','portfolio' );
    return $array;
share|improve this question

closed as off-topic by kaiser Aug 1 '14 at 23:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Short answer, you can't.

Having had a quick look through the BuddyBlog code, everything expects the filter to return a single post type.

My only suggestion is to contact the author & request support for multiple post types, or take it upon yourself to make the adjustments (the joys of open source!).

share|improve this answer
I am not familiar with PHP at all, so even I am not happy with this fact I gave you vote up for your quick and clear answer, I will contact Brajesh for multiple post types support. Thanks – Daniel Foltynek Jun 21 '13 at 6:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.