Add column Product type in WooCommerce

// 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

Duplicate Post/Page Link (copy)

// 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

WPCode Functions

// 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

Enable Drag And Drop Re-Ordering In Admin Dashboard

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

EDCC Alert Post

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

Duplicate Post/Page Link (copy)

// 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