This topic was closed but was not resolved so I am reposting.
I have multiple post types, but the example is not clear as to how to add more than one. I am getting an error when trying to update it. I think the issue is with the comma separator.
What is the correct code to add multiple custom post types to the example as outlined in
function add_builder_to_posttype($metabox)
{
foreach($metabox as &$meta)
{
if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
{
$meta['page'][] = 'event' ,'bar' ,'restaurants', 'saunas'; /*instead add the name of the custom post type here*/
}
}
return $metabox;
}
When I try that code I get an error from wordpress when updating the functions file.
Hey roamingk,
What is the error that you’re getting?
Best regards,
Victoria
Hi Victoria,
Wordpress yields the following result when saving.
Your PHP code changes were rolled back due to an error on line 656 of file wp-content/themes/enfold/functions.php. Please fix and try saving again.
syntax error, unexpected ‘,’
Hi,
I do not see any error from the code that she has provided.
Can you provide us with backend details?
Best regards,
Basilis
Hi,
I tried to login with Enfold users and it failed.
Best regards,
Basilis