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
add_action( ‘wp_before_admin_bar_render’, function () { global $wp_admin_bar; $wp_admin_bar->remove_menu( ‘wp-logo’ ); }, 0 );Continue reading
add_action( ‘admin_head’, function () { if ( current_user_can( ‘update_core’ ) ) { return; } remove_action( ‘admin_notices’, ‘update_nag’, 3 ); }, 1 );Continue reading
add_filter( ‘enable_login_autofocus’, ‘__return_false’ );Continue reading
remove_action( ‘after_password_reset’, ‘wp_password_change_notification’ );Continue reading
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_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_filter( ‘login_head’, function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = ‘https://netzinformatique.fr/assets/images/logo-k-586×748.png’; $logo_width = 84; $logo_height = 84; printf( ‘.login h1 a {background-image:url(%1$s) !important; margin:0…Continue reading
/** * 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