multiple record insert creating many duplicate records

For running in WP cron, you’ll define your function, and then hook the function to the cron’s name. Example: function cron_function() { … } add_action( ‘cron_hook’, ‘cron_function’ ); if ( ! wp_next_scheduled( ‘cron_hook’ ) ) { wp_schedule_event( time(), ‘one_minute’, ‘cron_hook’ ); } See WordPress developer resource for more info: https://developer.wordpress.org/plugins/cron/scheduling-wp-cron-events/

Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it

So, the answer isn’t as straightforward as I initially hoped. A quick test using memory_get_usage() on a local environment with only Twenty Sixteen enabled as the theme gives the following results: Memory usage before requiring plugin.php: 8496336 Memory usage after requiring plugin.php: 8583912 So, loading plugin.php takes up 87.576 bytes, or roughly 85KB. If you … Read more

Remove Gutenberg Buttons Block

This added to the functions.php allows the removal of specific Gutenberg blocks. function hide_default_blocks($allowed_block) { $blocks = WP_Block_Type_Registry::get_instance()->get_all_registered(); unset($blocks[‘core/buttons’]); return array_keys($blocks); } add_filter(‘allowed_block_types_all’, ‘hide_default_blocks’); Part of the issue is that it is core/buttons and not core/button but also the method of removal was incorrect.