开发者 |
epiphyt
kittmedia krafit |
---|---|
更新时间 | 2024年12月8日 05:26 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.7 |
版权: | GPL2 |
版权网址: | 版权信息 |
/wp-content/plugins/block-control
directory, or install the plugin through the WordPress plugins screen directly.After you install and activate Block Control, you will find a new panel “Visibility” added to every blocks right hand side sidebar. Open the panel to choose a condition for the display of a given block. Conditional blocks configured this way will only be displayed under certain circumstances chosen by you. Please note, these conditions will only take effect in the front end of your site, not inside the editor itself.
As Block Control removes content completely from the source code and not just hides it via CSS, it is mostly incompatible to any caching plugin because it may generate different HTML for every user.
Since version 1.1.0 you can hide blocks based on post type. Since you maybe have post types that don't make sense in this context, you can use the filter block_control_ignored_post_types
to remove them.
E.g. if your post type slug is called my_post_type
, you can use it like this:
`
function my_filter_block_control_post_types( $post_types ) {
unset( $post_types['my_post_type'];
return $post_types;
}
add_filter( 'block_control_ignored_post_types', 'my_filter_block_control_post_types' );
`
We are Epiph.yt, your friendly neighborhood WordPress plugin shop from southern Germany.
You can contribute to the code on GitHub.
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. Report a security vulnerability.
blockControl.unsupportedBlocks
without needing to load the own JavaScript early.blockControl.unsupportedBlocks
to filter the list of unsupported blocks.is_home
, is_page
, etc.)