S7 – Image optimization list

// Add custom page to display image list in the media menu function my_custom_image_list_page() { add_media_page( ‘Image List’, // Page title ‘Image List’, // Menu title ‘manage_options’, // Capability ‘image-list’, // Menu slug ‘my_custom_image_list_display’ // Function to display content );…Continue reading

Ruolo call center Nikon Store

function nvl_create_call_center_role() { // Rimuove il ruolo per cancellare eventuali vecchie capabilities (salvate in wp_options) //remove_role(‘nvl_call_center’); // Aggiungi un nuovo ruolo chiamato “NVL: Call Center” add_role( ‘nvl_call_center’, __(‘NVL: Call Center’, ‘textdomain’), array( //’read’ => true, // Permette di accedere alla…Continue reading

Ruolo call center Nikon Store

function nvl_create_call_center_role() { // Rimuove il ruolo per cancellare eventuali vecchie capabilities (salvate in wp_options) //remove_role(‘nvl_call_center’); // Aggiungi un nuovo ruolo chiamato “NVL: Call Center” add_role( ‘nvl_call_center’, __(‘NVL: Call Center’, ‘textdomain’), array( //’read’ => true, // Permette di accedere alla…Continue reading

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

/** * WPCode Admin UI Enhancements * – Skip library screen * – Set snippets per page * – Show active snippets first * – Adjust column widths and header wrapping * – Format Created column */ // 1. Skip…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