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
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
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