Silent-Print etichete/sku counters

add_action(‘woocommerce_admin_order_data_after_order_details’, function($order){ if (!$order instanceof WC_Order) return; $sku_counts = []; foreach ($order->get_items() as $item) { $product = $item->get_product(); if (!$product) continue; $sku = $product->get_sku(); if (!$sku || $sku==”mostre01″) continue; $qty = $item->get_quantity(); if (!isset($sku_counts[$sku])) { $sku_counts[$sku] = 0; } $sku_counts[$sku]…Continue reading

TEMPLATE Admin – Support Ticket Page

add_action(‘admin_menu’, ‘register_support_tickets_page’); function register_support_tickets_page() { add_menu_page( ‘Support Tickets’, // Page title (appears in tag) ‘Support Tickets’, // Menu title (appears in the sidebar) ‘edit_posts’, // Capability required to access ‘support-tickets’, // Menu slug (used in URL) ‘support_tickets_page_html’,// Callback function to…Continue reading

TEMPLATE Admin – Dashboard Welcome Widget

add_action(‘wp_dashboard_setup’, function() { wp_add_dashboard_widget( ‘custom_widget_welcome’, ‘Welcome’, ‘custom_dashboard_widget_welcome_display’ ); }); function custom_dashboard_widget_welcome_display() { $current_user = wp_get_current_user(); $display_name = esc_html($current_user->display_name); // EDIT SITE SPECIFIC DETAILS BELOW echo ‘ ‘; echo ‘ Hi ‘ . $display_name . ‘ 👋 ‘; echo ‘ Here…Continue reading

Admin – Docs Menu Item

// Add Menu Link add_action(‘admin_menu’, ‘add_docs_link’); function add_docs_link() { add_menu_page( ‘Documentation’, // Page title (not used, but required) ‘Documentation’, // Menu title (shows in admin sidebar) ‘edit_posts’, // Capability required ‘docs-redirect’, // Unique slug ‘redirect_to_docs’, // Callback function ‘dashicons-editor-ul’,// Optional…Continue reading

LabelPrinting ( Mihai )

/** * This API allows you to create your own “shortcodes” which you can add to label templates * and they will be replaced with values you fetch in api.php * Follow the documentation here: https://www.ukrsolution.com/Wordpress/Print-Barcode-Labels-for-WooCommerce-Products#details */ /******************************** * Add…Continue reading

Duplicate Post/Page Link

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

Enqueue Child Theme’s CSS & Additional CSS in WordPress Editor

/* Enqueue Child Theme style.css to editor */ add_filter(‘block_editor_settings_all’, function($editor_settings) { // Get the URL of the child theme’s style.css $child_theme_style_url = get_stylesheet_directory_uri() . ‘/style.css’; $editor_settings[‘styles’][] = array(‘css’ => wp_remote_get($child_theme_style_url)[‘body’]); return $editor_settings; }); /* Eunqueue Customizer CSS to editor */…Continue reading

Make Elementor Default Editor

/** * Comprehensive solution to make Elementor the default editor * while keeping the “Edit with Elementor” option */ /** * Redirect default WordPress editor to Elementor editor */ function redirect_default_editor_to_elementor() { global $pagenow; // Check if we’re on the…Continue reading