Completely Disable Comments (copy) (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Completely Disable Comments (copy) (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Completely Disable Comments (copy) (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Completely Disable Comments (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Completely Disable Comments (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Webhook custom aggiornamento stock – aggiunta dati prodotto

add_action(‘woocommerce_product_set_stock’, function($product) { do_action(‘wc_product_stock_updated’, [ ‘id’ => $product->get_id(), ‘sku’ => $product->get_sku(), ‘qty’ => $product->get_stock_quantity(), ‘status’ => $product->get_stock_status(), ]); }, 10, 1); add_action(‘woocommerce_variation_set_stock’, function($product) { do_action(‘wc_product_stock_updated’, [ ‘id’ => $product->get_id(), ‘parent_id’ => $product->get_parent_id(), ‘sku’ => $product->get_sku(), ‘qty’ => $product->get_stock_quantity(), ‘status’ =>…Continue reading

wpallimport Updated_at Last Edited

/** * WP All Import: only update a post if the feed’s updated_at is NEWER than the WP post’s modified date. * Network-activate this snippet for multisite if you run imports on subsites. */ add_filter(‘wp_all_import_is_post_to_update’, function ($continue_import, $post_id, $data, $import_id)…Continue reading