add_filter( ‘block_editor_settings_all’, function ( $settings, $context ) { // The default image size when added in the block editor. $settings[‘imageDefaultSize’] = ‘full’; return $settings; }, 10, 2 );Continue reading
add_filter( ‘block_editor_settings_all’, function ( $settings ) { if ( ! isset( $settings[‘blockInspectorTabs’] ) ) { $settings[‘blockInspectorTabs’] = array(); } $settings[‘blockInspectorTabs’] = array_merge( $settings[ ‘blockInspectorTabs’ ], array( ‘default’ => false, // Disables for all blocks. ), ); return $settings; } );Continue reading
add_filter( ‘block_editor_settings_all’, function( $settings, $context ) { $settings[‘enableOpenverseMediaCategory’] = false; return $settings; }, 10, 2 );Continue reading
add_action( ‘current_screen’, function () { $screen = get_current_screen(); // Add other custom post types here as needed. if ( in_array( $screen->id, array( ‘post’, ‘page’ ) ) ) { remove_theme_support( ‘block-templates’ ); } } );Continue reading
// Add a new setting in wp-admin > Settings > General add_action( ‘admin_init’, function() { register_setting( ‘general’, ‘custom_heartbeat_interval’, ‘intval’ ); add_settings_field( ‘custom_heartbeat_interval’, ‘Heartbeat Interval’, function() { $interval = get_option( ‘custom_heartbeat_interval’, 120 ); echo “ seconds”; }, ‘general’ ); }); add_filter(…Continue reading
add_filter( ‘aioseo_woocommerce_breadcrumb_hide_shop’, ‘__return_true’ );Continue reading
/** * Do not store the cached IP address in a hidden field * * @link https://wpforms.com/developers/how-to-store-the-non-cached-ip-address-into-a-hidden-field/ */ function wpf_hidden_ip_avoid_cache( $fields, $entry, $form_data ){ // Only run on the form with ID 727 if( $form_data[ ‘id’ ] == 727 )…Continue reading
// Schedule the event if it is not already scheduled function schedule_unattached_media_cleanup() { if (!wp_next_scheduled(‘delete_unattached_media_event’)) { wp_schedule_event(time(), ‘daily’, ‘delete_unattached_media_event’); } } add_action(‘wp’, ‘schedule_unattached_media_cleanup’); // Hook the function to the scheduled event add_action(‘delete_unattached_media_event’, ‘delete_unattached_media’); // Function to delete unattached media function…Continue reading