Disable Gutenberg Editor (use Classic Editor)
add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 10); add_filter(‘use_block_editor_for_post’, ‘__return_false’, 10);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 10); add_filter(‘use_block_editor_for_post’, ‘__return_false’, 10);Continue reading
/** * Plugin Name: Elite Web Labs Newsletters * Description: A plugin that allows for sending newsletters when publishing posts * Version: 1.0.4 * Author: Thomas Senecal * License: GPL-2.0+ * Text Domain: newsletter */ // If this file is…Continue reading
// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { $product = wc_get_product( $post_id ); if ( !$product ) { return; } $featured_image_id = $product->get_image_id(); $image_galleries_id = $product->get_gallery_image_ids(); if( !empty(…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_action( ‘admin_init’, function () { // Get all public post types $post_types = get_post_types( array(), ‘names’ ); function wpcode_add_post_id_column( $columns ) { $columns[‘wpcode_post_id’] = ‘ID’; // ‘ID’ is the column title return $columns; } function wpcode_show_post_id_column_data( $column, $post_id ) {…Continue reading
add_action( ‘admin_init’, function() { remove_action(‘admin_color_scheme_picker’, ‘admin_color_scheme_picker’); });Continue reading
add_action( ‘add_meta_boxes’, function () { if ( ! current_user_can( ‘manage_options’ ) ) { // Don’t display the metabox to users who can’t manage options return; } add_meta_box( ‘wpcode-view-post-meta’, ‘Post Meta’, function () { $custom_fields = get_post_meta( get_the_ID() ); ?> Meta…Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
/** * Adds the ‘tinymce_abbr_class’ button to the ‘Basic’ toolbar in the ACF WYSIWYG editor. * * Hooks into the ACF WYSIWYG toolbar configuration to append the ‘tinymce_abbr_class’ button * to the ‘Basic’ toolbar. It checks if the ‘Basic’ toolbar…Continue reading
remove_action(‘enqueue_block_editor_assets’, ‘wp_enqueue_editor_block_directory_assets’);Continue reading