Untitled Snippet
// Disable Gutemberg 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!
// Disable Gutemberg add_filter( ‘use_block_editor_for_post’, ‘__return_false’, 10 );Continue reading
// Add column: Product type add_filter( ‘manage_edit-product_columns’, ‘huk_admin_products_visibility_column’); function huk_admin_products_visibility_column( $columns ){ $columns[‘product_type’] = ‘Type’; return $columns; } add_action( ‘manage_product_posts_custom_column’, ‘huk_admin_products_visibility_column_content’, 20, 2 ); function huk_admin_products_visibility_column_content( $column, $product_id ){ if ( $column == ‘product_type’ ) { $product = wc_get_product( $product_id…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
// Skip show library screen add_filter( ‘wpcode_add_snippet_show_library’, ‘__return_false’ ); // Move status column add_filter( ‘wpcode_code_snippets_table_columns’, function ( $columns ) { if ( isset( $columns[‘status’] ) ) { $status = $columns[‘status’]; unset( $columns[‘status’] ); $columns = array_slice( $columns, 0, 1, true…Continue reading
add_filter( ‘wpcode_snippets_per_page’, function() { return 25; });Continue reading
function enqueue_admin_reorder_scripts() { global $pagenow; // Ensure the script is not loaded on the plugins page if ($pagenow !== ‘plugins.php’) { wp_enqueue_script(‘jquery-ui-sortable’); wp_add_inline_script(‘jquery-ui-sortable’, ‘ jQuery(document).ready(function($) { var $sortableList = $(“#the-list”); var postType = $(“body”).attr(“class”).match(/post-type-([^\s]+)/)[1]; $sortableList.sortable({ update: function(event, ui) { var…Continue reading
define(‘SUBDIRECTORY’, ‘modernpos’);Continue reading
function edcc_save_post_webhook($post_id, $post) { // Check to see if autosaving etc., if so ignore if ($post->post_status !== ‘publish’) { return; } if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) { return; } // Check if it is a REST Request if ( defined(…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
add_action(‘admin_head’, ‘sep_color’); function sep_color() { echo ‘ ‘; }Continue reading