{"id":116503,"date":"2020-01-30T23:42:05","date_gmt":"2020-01-30T23:42:05","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/block-visibility\/"},"modified":"2026-02-21T22:00:26","modified_gmt":"2026-02-21T22:00:26","slug":"responsive-block-control","status":"publish","type":"plugin","link":"https:\/\/mri.wordpress.org\/plugins\/responsive-block-control\/","author":8195469,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.3.2","stable_tag":"1.3.2","tested":"6.9.4","requires":"5.2","requires_php":"7.4","requires_plugins":null,"header_name":"Responsive Block Control","header_author":"Sascha Paukner","header_description":"Block Visibility adds responsive toggles to a \"Visibility\" panel of the block editor to show or hide blocks according to screen width.","assets_banners_color":"951b81","last_updated":"2026-02-21 22:00:26","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/saschapaukner.de","header_plugin_uri":"","header_author_uri":"https:\/\/saschapaukner.de","rating":5,"author_block_rating":0,"active_installs":1000,"downloads":14537,"num_ratings":4,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"landwire","date":"2020-12-11 19:27:47"},"1.1.0":{"tag":"1.1.0","author":"landwire","date":"2021-04-04 10:39:08"},"1.1.1":{"tag":"1.1.1","author":"landwire","date":"2021-04-18 21:36:14"},"1.2.0":{"tag":"1.2.0","author":"landwire","date":"2021-04-20 22:12:24"},"1.2.1":{"tag":"1.2.1","author":"landwire","date":"2021-08-05 17:04:16"},"1.2.2":{"tag":"1.2.2","author":"landwire","date":"2021-08-05 17:39:48"},"1.2.3":{"tag":"1.2.3","author":"landwire","date":"2021-08-17 15:08:59"},"1.2.4":{"tag":"1.2.4","author":"landwire","date":"2021-09-23 15:47:10"},"1.2.5":{"tag":"1.2.5","author":"landwire","date":"2022-03-17 16:03:51"},"1.2.6":{"tag":"1.2.6","author":"landwire","date":"2022-10-01 11:41:36"},"1.2.7":{"tag":"1.2.7","author":"landwire","date":"2022-10-01 11:42:23"},"1.2.8":{"tag":"1.2.8","author":"landwire","date":"2023-09-24 10:57:57"},"1.2.9":{"tag":"1.2.9","author":"landwire","date":"2023-10-06 23:44:47"},"1.3.0":{"tag":"1.3.0","author":"landwire","date":"2026-01-09 14:14:41"},"1.3.1":{"tag":"1.3.1","author":"landwire","date":"2026-01-14 11:43:59"},"1.3.2":{"tag":"1.3.2","author":"landwire","date":"2026-02-21 22:00:26"}},"upgrade_notice":{"":"<p>Nothing to consider.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":4},"assets_icons":{"icon-256x256.png":{"filename":"icon-256x256.png","revision":2236128,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":2236128,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2236119,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2236119,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{"blueprint.json":{"filename":"blueprint.json","revision":3466617,"resolution":false,"location":"assets","locale":"","contents":"{\"$schema\":\"https:\\\/\\\/playground.wordpress.net\\\/blueprint-schema.json\",\"landingPage\":\"\\\/?p=6\",\"preferredVersions\":{\"php\":\"8.1\",\"wp\":\"latest\"},\"phpExtensionBundles\":[\"kitchen-sink\"],\"steps\":[{\"step\":\"login\",\"username\":\"admin\",\"password\":\"password\"},{\"step\":\"installPlugin\",\"options\":{\"activate\":true},\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"responsive-block-control\"}},{\"step\":\"runPHP\",\"code\":\"<?php\\ninclude 'wordpress\\\/wp-load.php';\\nwp_insert_post(array(\\n'import_id' => 6,\\n'post_title' => 'Responsive Block Control',\\n'post_type' => 'page',\\n'post_content' => '<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"wide\\\":true,\\\"desktop\\\":true,\\\"tablet\\\":true,\\\"mobile\\\":false}} -->\\n<p>Visible on Mobile<\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"wide\\\":true,\\\"desktop\\\":true,\\\"mobile\\\":true}} -->\\n<p>Visible on Tablet<\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"wide\\\":true,\\\"tablet\\\":true,\\\"mobile\\\":true,\\\"desktop\\\":false}} -->\\n<p>Visible on Desktop<\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"desktop\\\":true,\\\"tablet\\\":true,\\\"mobile\\\":true,\\\"wide\\\":false}} -->\\n<p>Visible on Wide<\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:group {\\\"layout\\\":{\\\"type\\\":\\\"flex\\\",\\\"flexWrap\\\":\\\"nowrap\\\"}} -->\\n<div class=\\\"wp-block-group\\\"><!-- wp:paragraph -->\\n<p>Current Viewport Size is: <\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"wide\\\":true,\\\"desktop\\\":true,\\\"tablet\\\":true}} -->\\n<p><strong>Mobile<\\\/strong><\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"wide\\\":true,\\\"desktop\\\":true,\\\"mobile\\\":true}} -->\\n<p><strong>Tablet<\\\/strong><\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"wide\\\":true,\\\"tablet\\\":true,\\\"mobile\\\":true,\\\"desktop\\\":false}} -->\\n<p><strong>Desktop<\\\/strong><\\\/p>\\n<!-- \\\/wp:paragraph -->\\n\\n<!-- wp:paragraph {\\\"responsiveBlockControl\\\":{\\\"desktop\\\":true,\\\"tablet\\\":true,\\\"mobile\\\":true,\\\"wide\\\":false}} -->\\n<p><strong>Wide<\\\/strong><\\\/p>\\n<!-- \\\/wp:paragraph --><\\\/div>\\n<!-- \\\/wp:group -->',\\n'post_status' => 'publish',\\n'post_author' => 1\\n));\"}]}"}},"all_blocks":[],"tagged_versions":["1.0.0","1.1.0","1.1.1","1.2.0","1.2.1","1.2.2","1.2.3","1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.3.0","1.3.1","1.3.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2236119,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"The 'Responsive Block Control' toggles at work in the block editor."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1220,5237,606,6309,26984],"plugin_category":[],"plugin_contributors":[180763],"plugin_business_model":[],"class_list":["post-116503","plugin","type-plugin","status-publish","hentry","plugin_tags-block","plugin_tags-hide-content","plugin_tags-responsive","plugin_tags-visibility","plugin_tags-width","plugin_contributors-landwire","plugin_committers-landwire"],"banners":{"banner":"https:\/\/ps.w.org\/responsive-block-control\/assets\/banner-772x250.png?rev=2236119","banner_2x":"https:\/\/ps.w.org\/responsive-block-control\/assets\/banner-1544x500.png?rev=2236119","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/responsive-block-control\/assets\/icon.svg?rev=2236128","icon":"https:\/\/ps.w.org\/responsive-block-control\/assets\/icon.svg?rev=2236128","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/responsive-block-control\/assets\/screenshot-1.png?rev=2236119","caption":"The 'Responsive Block Control' toggles at work in the block editor."}],"raw_content":"<!--section=description-->\n<p>Responsive Block Control adds responsive toggles to a \"Visibility\" panel of the block editor, to show or hide blocks according to screen width.<\/p>\n\n<h3>Security<\/h3>\n\n<p><strong>Version 1.3.1 resolves a stored cross\u2011site scripting (XSS) vulnerability (CVE\u20112025\u201162135) affecting earlier versions (&lt;= 1.2.9).<\/strong>\nUsers with contributor access or higher should update immediately.<\/p>\n\n<p>If you discover a security vulnerability, please report it responsibly to: security@saschapaukner.de<\/p>\n\n<h4>Limitations<\/h4>\n\n<p>Does not work with the Classic Block, Widget Block or Widget Area Block ['core\/freeform', 'core\/legacy-widget', 'core\/widget-area'], as the those blocks do not support block attributes. Does also not work with the HTML Block ['core\/html'] inside the Widget Screen, as this one also does not support block attributes there.<\/p>\n\n<h3>Configuration<\/h3>\n\n<h4>Override existing breakpoints<\/h4>\n\n<pre><code>function override_responsive_block_control_breakpoints($break_points) {\n     $break_points['base'] = 0;\n     $break_points['mobile'] = 400;\n     $break_points['tablet'] = 800;\n     $break_points['desktop'] = 1000;\n     $break_points['wide'] = 1600;\n\n     return $break_points;\n }\n\n add_filter('responsive_block_control_breakpoints', 'override_responsive_block_control_breakpoints');\n<\/code><\/pre>\n\n<h4>Provide custom CSS<\/h4>\n\n<p>You can provide your own CSS rules per breakpoint using the new filter responsive_block_control_custom_css_rules.<\/p>\n\n<pre><code>add_filter('responsive_block_control_custom_css_rules', function($rules) {\n    return [\n        'mobile'  =&gt; 'display: none !important;',\n        'tablet'  =&gt; 'display: none !important;',\n        'desktop' =&gt; 'display: none !important;',\n        'wide'    =&gt; 'display: none !important;',\n    ];\n});\n<\/code><\/pre>\n\n<h4>Stop css output completely<\/h4>\n\n<pre><code> function override_responsive_block_control_add_css() {\n      return false;\n  }\n  add_filter('responsive_block_control_breakpoints', 'override_responsive_block_control_add_css');\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>responsive-block-control.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"is%20it%20possible%20to%20use%20different%20breakpoints%3F\"><h3>Is it possible to use different breakpoints?<\/h3><\/dt>\n<dd><p>Yes, use the following code in your functions.php or similar.<\/p>\n\n<pre><code>function override_responsive_block_control_breakpoints($break_points) {\n     $break_points['base'] = 0;\n     $break_points['mobile'] = 400;\n     $break_points['tablet'] = 800;\n     $break_points['desktop'] = 1000;\n     $break_points['wide'] = 1600;\n\n     return $break_points;\n }\n\n add_filter('responsive_block_control_breakpoints', 'override_responsive_block_control_breakpoints');\n<\/code><\/pre><\/dd>\n<dt id=\"can%20i%20provide%20custom%20css%20per%20breakpoint%3F%20i%20want%20to%20display%3A%20none%20instead%20of%20hiding%20just%20visually\"><h3>Can I provide custom CSS per breakpoint? I want to display: none instead of hiding just visually<\/h3><\/dt>\n<dd><p>Yes, use the responsive_block_control_custom_css_rules filter:<\/p>\n\n<pre><code>add_filter('responsive_block_control_custom_css_rules', function($rules) {\n    return [\n        'mobile'  =&gt; 'display: none !important;',\n        'tablet'  =&gt; 'display: none !important;',\n        'desktop' =&gt; 'display: none !important;',\n        'wide'    =&gt; 'display: none !important;',\n    ];\n});\n<\/code><\/pre>\n\n<p>This ensures the CSS respects the current breakpoints and applies to the correct .rbc-is-hidden-on-{breakpoint} classes.<\/p><\/dd>\n<dt id=\"can%20i%20write%20my%20own%20css%20and%20just%20use%20the%20classes%3F\"><h3>Can I write my own CSS and just use the classes?<\/h3><\/dt>\n<dd><p>Yes, that is absolutely possible. Just use the filter below to stop the plugin from injecting its' styles:<\/p>\n\n<pre><code>function override_responsive_block_control_add_css() {\n     return false;\n }\n add_filter('responsive_block_control_breakpoints', 'override_responsive_block_control_add_css');\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.3.2<\/h4>\n\n<ul>\n<li>Removed console.log<\/li>\n<\/ul>\n\n<h4>1.3.1<\/h4>\n\n<ul>\n<li>Security fix: Mitigated authenticated Stored XSS (CVE\u20112025\u201162135).<\/li>\n<li>Added responsive_block_control_custom_css_rules filter to allow developers to provide their own CSS per breakpoint<\/li>\n<li>Fixed media query generation to match breakpoints correctly<\/li>\n<li>Ensured JS only injects CSS if customCss is present and sanitized<\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>Raised version after testing and package updates<\/li>\n<\/ul>\n\n<h4>1.2.9<\/h4>\n\n<ul>\n<li>Added check to not load editor assets in the front end<\/li>\n<\/ul>\n\n<h4>1.2.8<\/h4>\n\n<ul>\n<li>Updated asset loading for changes introduced in WordPress 6.3<\/li>\n<li>Added \"Limitations\" section to readme<\/li>\n<\/ul>\n\n<h4>1.2.7<\/h4>\n\n<p>Recompiled assets for distribution<\/p>\n\n<h4>1.2.6<\/h4>\n\n<ul>\n<li>fixed translation for visibility information<\/li>\n<li>added check for Classic Block and disabled display of settings there<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>fixed some JS logic<\/li>\n<li>added visibility information to blocks in Gutenberg editor<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>fixed regex for adding classes in the frontend<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Removed the \"blocks.getSaveContent.extraProps\" JS filter as it causes block validation errors<\/li>\n<li>Instead we are using the recommended PHP filter \"render_block\" to add the necessary classes vie preg_replace()<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial Release of the plugin<\/li>\n<\/ul>","raw_excerpt":"Responsive Block Control adds responsive toggles to a &quot;Visibility&quot; panel of the block editor, to show or hide blocks according to screen width.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/116503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=116503"}],"author":[{"embeddable":true,"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/landwire"}],"wp:attachment":[{"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=116503"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=116503"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=116503"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=116503"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=116503"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/mri.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=116503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}