Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created April 13, 2020 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/bcccd548f5895ed00db65fe909e7d0ba to your computer and use it in GitHub Desktop.
Save joshfeck/bcccd548f5895ed00db65fe909e7d0ba to your computer and use it in GitHub Desktop.
Activate Yoast SEO plugin's meta box on Event Espresso CPT editor routes.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action('plugins_loaded', 'my_ee_yoast_seo_box');
function my_ee_yoast_seo_box() {
if (
! empty($_GET['page'])
&&
in_array(
$_GET['page'],
array(
'espresso_events',
'espresso_venues',
'espresso_people'
)
)
) {
add_filter(
'wpseo_always_register_metaboxes_on_admin',
'__return_true'
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment