Created
December 26, 2024 15:47
-
-
Save tdmrhn/3a373d83e7e8f80caddea8df5dea4ac6 to your computer and use it in GitHub Desktop.
Blocksy 2: Disable all Content Blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('init', function() { | |
$all_content_blocks = get_posts([ | |
'post_type' => 'ct_content_block', | |
'posts_per_page' => -1, | |
'post_status' => 'publish', | |
'fields' => 'ids' | |
]); | |
foreach ($all_content_blocks as $block_id) { | |
$atts = blocksy_get_post_options($block_id); | |
$atts['is_hook_enabled'] = 'no'; | |
update_post_meta($block_id, 'blocksy_post_meta_options', $atts); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment