Skip to content

Instantly share code, notes, and snippets.

@rmarcano
Created November 19, 2024 17:36
Show Gist options
  • Save rmarcano/f65e5d46af3aab803da0f3e88461710d to your computer and use it in GitHub Desktop.
Save rmarcano/f65e5d46af3aab803da0f3e88461710d to your computer and use it in GitHub Desktop.
Shortcode analysis.
#in functions.php
wp_enqueue_script(
'my-shortcodes-filter',
get_template_directory_uri() . '/js/MyShortcodesFilter.js',
[ WPSEO_Admin_Asset_Manager::PREFIX . 'analysis' ],
'1.0',
true
);
const getShortcodes = (shortcodes) => {
shortcodes.push("analyze_field");
return shortcodes;
};
wp.hooks.addFilter( "yoast.analysis.shortcodes", "getShortcodes", getShortcodes );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment