Open gdandrija opened 3 years ago
@gdandrija Thanks for reporting. I'm not sure I understand how this solve the problem. We are currently registering on init
a custom post type on the standard priority which seems to be standard practice. @jrtashjian might provide more input here. Maybe that custom post type isn't meant to be public at all and that is what's missing here.
@jonathanbardo The standard priority works great when registering the post type, but the issue is the load_block_patterns-method.
I would say that load_block_patterns()-method should have a priority higher than register_post_type()-method to make sure it's actually loaded after the post types is registered. Sure, it loads after your registered post type, coblocks_pattern, but not other registered post types.
The following is true & tested: Registered post types with a priority of 10 (default) loads after the load_block_patterns()-method. If I set 9 as the priority for my registered custom post type the OG tags is injected correctly.
Hope that makes sense. Thanks.
We still have this issue when using the SEO Framework and Coblocks together on a client site. We used to be able to change the priority of our own custom post types and this fixed it but we're now having to edit the plugin using the temporary fix above.
Describe the bug:
CoBlocks is incompatible with The SEO Framework, this applies custom post types that use init hook with the priority of 10
To reproduce:
Expected behavior:
I should see of metadata inserted
Isolating the problem:
WordPress version:
5.8.1
Gutenberg version:
/
Temporary fix:
Insert the following code snippet to override the function priority set in /includes/class-block-patterns.php on line 33
add_action( 'init', array( $this, 'load_block_patterns' ), 15, 0 );
Issue and the fix initially submitted by user henjak on WordPress.org: https://wordpress.org/support/topic/open-graph-tags-from-the-seo-framework-not-injected-on-custom-post-types/