← ClaudeAtlas

orbit-block-bindingslisted

Audit Block Bindings API usage — the WP 6.5+ way to bind block attributes to dynamic data sources (post meta, options, custom sources) without writing custom render filters or hacks. Catches plugins still using the old `render_block` filter pattern that should migrate. Use when the user says "block bindings", "bind block attribute", "post meta in block", "WP 6.5 block API", or modernising a custom-render filter.
adityaarsharma/orbit · ★ 1 · Testing & QA · score 55
Install: claude install-skill adityaarsharma/orbit
# 🪐 orbit-block-bindings — Block Bindings API audit Pre-WP 6.5 you wrote a `render_block` filter to inject post-meta into a block. WP 6.5 ships the Block Bindings API — declarative, performant, and works in the editor too. This skill catches code that should migrate. --- ## Quick start ```bash claude "/orbit-block-bindings Audit ~/plugins/my-plugin for legacy render_block filter patterns that should migrate to Block Bindings." ``` --- ## What it checks ### 1. Legacy `render_block` patterns **Whitepaper intent:** A filter that finds-and-replaces text in `$block_content` is brittle (markup changes break it), slow (runs on every block render), and invisible to the editor (preview shows the wrong content). ```php // ❌ Legacy approach add_filter( 'render_block', function( $block_content, $block ) { if ( $block['blockName'] === 'core/paragraph' ) { $price = get_post_meta( get_the_ID(), 'price', true ); return str_replace( '{{price}}', esc_html( $price ), $block_content ); } return $block_content; }, 10, 2 ); // ✅ Block Bindings (WP 6.5+) add_action( 'init', function() { register_block_bindings_source( 'my-plugin/post-price', [ 'label' => __( 'Post Price', 'my-plugin' ), 'get_value_callback' => function( $args, $block ) { return get_post_meta( $block->context['postId'], 'price', true ); }, 'uses_context' => [ 'postId' ], ] ); } ); ``` The block then references it: ```html <!-- wp:paragraph {"metadata":{"bindings":{"content":{"source