This feature is for users of the Custom Post Type Builder Addon who are also using SiteOrigin themes that offer page settings functionality. It allows you to enforce global page settings across custom post types, disabling page-specific settings for consistency across your content.
How to Use
You can add these filters using either:
– The Code Snippets plugin (recommended for easier management).
– A child theme `functions.php` file.
Enforce Global Settings for All Post Types
To always use global settings across all custom post types, add this filter:
add_filter( 'siteorigin_premium_cptb_enforce_global_page_settings', '__return_true' );
Enforce Global Settings for Specific Post Types
To enforce global settings only for specific post types, you can use a conditional filter. For example, to enforce global settings only for a post type called `test`:
add_filter( 'siteorigin_premium_cptb_enforce_global_page_settings', function( $enforce, $type ) { if ( $type === 'test' ) { return true; } return $enforce; }, 10, 2 );
Important Notes
- The page-specific page settings metabox will still be visible in the post editor, but the settings won’t take effect when this filter is active.
- This feature addresses previous functionality where page-specific page settings were present but never worked correctly.
- The filter ensures that all posts of the affected post type(s) will use the global theme settings.
Use Cases
This filter is particularly useful when:
- You want consistent page layouts across all posts of a custom post type.
- You’re managing a site where editors shouldn’t be able to override global design settings.
- You need to ensure brand consistency across custom content types.