Catch and filter-All schema json arrays before output
-
This is a notice not a bug. We are missing filters for the author and search json output, would it be possible to add such in future release? And a catch all filter would be nice. For now, we end up like this:
add_filter('schema_output', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_about_page_output', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_json_ld_breadcrumb_array', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_contact_page_output', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_taxonomy_json', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_tag_json', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_category_json', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_wp_knowledge_graph_json', 'entex_monitor_collect_schema_plugin_schema', 99); add_filter('schema_blog_output', 'entex_monitor_collect_schema_plugin_schema', 99); /* added in core file author and search */ add_filter('FIX_schema_plugin', 'entex_monitor_collect_schema_plugin_schema', 99);
The filter(s) make it possible to change or inject one or more properites. A catch all filter at the end of each core LAST output function would prefered like this:
$type = 'blog'; // or $type = 'taxonomy'; $schema = apply_filters('schema_all_output', $schema, $type); $output = '<script .. json_encode($schema):..
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Catch and filter-All schema json arrays before output’ is closed to new replies.