Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1175106

    Hi,

    I am using the following function that is working fine:

    function avf_alb_supported_post_types_mod( array $supported_post_types )
    {
    $supported_post_types[] = ‘members’;
    return $supported_post_types;
    }
    add_filter(‘avf_alb_supported_post_types’, ‘avf_alb_supported_post_types_mod’, 10, 1);

    However, I need to add this for another post type as well so that the builder will show on two custom post types.

    How can I make this possible please

    #1175247

    Hey MIMMT,

    You should be able to add them using an array instead, something like this:

    function avf_alb_supported_post_types_mod( array $supported_post_types )
    {
    $supported_post_types[] = array('members', 'newcpt1', 'newcpt2');
    return $supported_post_types;
    }
    add_filter('avf_alb_supported_post_types', 'avf_alb_supported_post_types_mod', 10, 1);

    Best regards,
    Rikard

    #1175255

    Hi again,

    I’m not sure the above will work, if not then please try comma separated instead:

    function avf_alb_supported_post_types_mod( array $supported_post_types )
    {
    $supported_post_types[] = 'members', 'newcpt1', 'newcpt2';
    return $supported_post_types;
    }
    add_filter('avf_alb_supported_post_types', 'avf_alb_supported_post_types_mod', 10, 1);

    Best regards,
    Rikard

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.