• Resolved alexzaragoza21

    (@alexzaragoza21)


    Good morning jetpack team, I am very happy using your plugin. It is really the best of all. However, I have a sort of tech something problem. please help me with this.

    I found this code to allow a different post type.

    function allow_my_post_types($allowed_post_types) {
    $allowed_post_types[] = ‘wpdmpro’;
    return $allowed_post_types;
    }
    add_filter( ‘rest_api_allowed_post_types’, ‘allow_my_post_types’ );

    however, because I am not an expert, I dont know how to allow other post types aside from ‘wpdpro’. I want to allow ‘topic’ and ‘dwqa-question’ also. (sorry just learning by myself)

    Hope you can guide me here.

    And one more thing, is the related post module will work in bb press topics? thank you so much in advance. I hope for the continuous success of everybody in your team.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter alexzaragoza21

    (@alexzaragoza21)

    I tried this but it did not work. and it broke my website.

    function allow_my_post_types($allowed_post_types) {
    $allowed_post_types[] = ‘wpdmpro’,’topic’,’dwqa-question’;
    return $allowed_post_types;
    }
    add_filter( ‘rest_api_allowed_post_types’, ‘allow_my_post_types’ );

    Thread Starter alexzaragoza21

    (@alexzaragoza21)

    Hello Jetpack team, your help will be greatly appreciated.

    I have this code now. Dont know If this will work.

    function allow_my_post_types($allowed_post_types) {
    $allowed_post_types[] = ‘wpdmpro’;
    $allowed_post_types[] = ’topic’;
    $allowed_post_types[] = ’dwqa-question’;
    return $allowed_post_types;
    }
    add_filter( ‘rest_api_allowed_post_types’, ‘allow_my_post_types’ );

    Thank you so much. I am willing to wait for your response. I hope for the whole success of your team.

    Plugin Support MadHatter (a11n)

    (@madhattersez)

    Hello, there!

    Custom code or integration is definitely outside the scope of our support – While we can provide those filters for you, actually implementing them with your custom post types is not something we can assist with.

    The best options for help on that would be your web host or to hire a developer / designer.

    So, we wouldn’t be able to help you with that directly, but I hope this points you in the right direction!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to allow multiple post types in related post module’ is closed to new replies.