WordPress filter hook · part of WordPress core

block_parser_class

A WordPress core filter that 9 plugins also fire themselves, running on 779K+ sites between them.

“Filter to allow plugins to replace the server-side block parser”

How to use block_parser_class

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'block_parser_class', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from Kadence Blocks's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

9 plugins that fire block_parser_class

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Kadence Blocks icon Kadence Blocks600,000+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) includes/form-ajax.php:672
  2. Gutenberg Essential Blocks icon Gutenberg Essential Blocks100,000+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) includes/Core/FaqSchema.php:146
  3. Easy MCP AI icon Easy MCP AI40,000+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) includes/tools/posts/class-block-locator.php:17
  4. FunnelKit icon FunnelKit30,000+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) modules/checkouts/builder/gutenberg/class-wfacp-gutenberg-template.php:86
  5. SlingBlocks icon SlingBlocks6,000+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) includes/class-slingblocks-frontend-css.php:117
  6. Accordion Toggle icon Accordion Toggle2,000+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) includes/class-faq-schema.php:198
  7. Subscriptions for WooCommerce Recurring Payments with Membership Content Restriction icon Subscriptions for WooCommerce Recurring Payments with Membership Content Restriction800+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) src/Features/GutenbergIntegration/Services/EditorContentCompatibility.php:181
  8. Gutenberg Blocks for AMP with Design Library icon Gutenberg Blocks for AMP with Design Library50+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) dist/class-amp-blocks-frontend.php:3623
  9. Quizess icon Quizess10+ installs apply_filters( 'block_parser_class', 'WP_Block_Parser' ) src/blocks/class-blocks-utils.php:51

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.