Publish Future Posts

function fulano_prevent_future_type( $post_data ) { if ( $post_data[‘post_status’] == ‘future’ ) { $post_data[‘post_status’] = ‘publish’; } return $post_data; } add_filter(‘wp_insert_post_data’, ‘fulano_prevent_future_type’); remove_action(‘future_post’, ‘_future_post_hook’);Continue reading

Disable Fullscreen Editor

add_action( ‘enqueue_block_editor_assets’, function () { $script = “jQuery( window ).load(function() { const isFullscreenMode = wp.data.select( ‘core/edit-post’ ).isFeatureActive( ‘fullscreenMode’ ); if ( isFullscreenMode ) { wp.data.dispatch( ‘core/edit-post’ ).toggleFeature( ‘fullscreenMode’ ); } });”; wp_add_inline_script( ‘wp-blocks’, $script ); } );Continue reading

Add Media File Size Column

add_filter( ‘manage_upload_columns’, function ( $columns ) { $columns [‘file_size’] = esc_html__( ‘File size’ ); return $columns; } ); add_action( ‘manage_media_custom_column’, function ( $column_name, $media_item ) { if ( ‘file_size’ !== $column_name || ! wp_attachment_is_image( $media_item ) ) { return; }…Continue reading

Add Custom Tab – V2

/** * Add a custom product data tab */ add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ ); function woo_new_product_tab( $tabs ) { // Adds the new tab $tabs[‘test_tab’] = array( ‘title’ => __( ‘New Product Tab’, ‘woocommerce’ ), ‘priority’ => 50, ‘callback’ => ‘woo_new_product_tab_content’…Continue reading