Location: everywhere
Add vendor id and name to CSV commissions export
if ( ! function_exists( ‘wcv_add_vendor_id_col_data’ ) ) { /** * Add vendor id to CSV data * * @param array $row_data The row data. * @param int $vendor_id The vendor id. */ function wcv_add_vendor_id_col_data( $row_data, $vendor_id ) { if (…Continue reading
The commission is only log when the order status is completed
if ( ! function_exists( ‘wcv_log_commission_order_status’ ) ) { /** * Log commission when order status is ? * * @param array $order_statuses The order statuses. * @return array */ function wcv_log_commission_order_status( $order_statuses ) { $key = array_search( ‘processing’, $order_statuses, true…Continue reading
Remove title on all pages for Hello Theme
function ele_disable_page_title( $return ) { return false; } add_filter( ‘hello_elementor_page_title’, ‘ele_disable_page_title’ );Continue reading
Disable Full Site Editing (FSE) (copy)
add_action( ‘admin_menu’, function() { remove_submenu_page(‘themes.php’, ‘site-editor.php’); }); add_action(‘admin_bar_menu’, function($wp_admin_bar) { $wp_admin_bar->remove_node(‘site-editor’); }, 250); add_action(‘admin_init’, function() { global $pagenow; if (‘site-editor.php’ === $pagenow) { wp_safe_redirect(admin_url()); exit; } });Continue reading
Site Security & Optimization
// Disable Yoast SEO HTML Comments add_filter(‘wpseo_debug_markers’, ‘__return_false’); // Disable XML-RPC add_filter(‘xmlrpc_enabled’, ‘__return_false’); // Remove WordPress Version Number add_filter(‘the_generator’, ‘__return_empty_string’); // Disable Plugin & Theme Editor if (!defined(‘DISALLOW_FILE_EDIT’)) { define(‘DISALLOW_FILE_EDIT’, true); } // Disable Author Archives add_action(‘template_redirect’, function(){ global $wp_query;…Continue reading
Woocommerce category archive sort products by date by default
add_filter(‘woocommerce_default_catalog_orderby’, ‘quadlayers_catalog_orderby_for_category’); function quadlayers_catalog_orderby_for_category( $sort_by ) { if( !is_product_category(‘gramatas’) ) { return $sort_by; // modify gramatas category archive sorting } return ‘date’; }Continue reading
Update the author name on published recipes
add_filter( ‘tasty_recipes_recipe_template_vars’, function( $template_vars ) { $template_vars[‘recipe_author_name’] = ‘New name here’; //Replace New name here $template_vars[‘recipe_details’][‘author’][‘value’] = ‘‘ . $template_vars[‘recipe_author_name’] . ‘‘; return $template_vars; } );Continue reading
Disable Full Site Editing (FSE)
add_action( ‘admin_menu’, function() { remove_submenu_page(‘themes.php’, ‘site-editor.php’); }); add_action(‘admin_bar_menu’, function($wp_admin_bar) { $wp_admin_bar->remove_node(‘site-editor’); }, 250); add_action(‘admin_init’, function() { global $pagenow; if (‘site-editor.php’ === $pagenow) { wp_safe_redirect(admin_url()); exit; } });Continue reading
Disable Posts in Admin
add_action( ‘admin_bar_menu’, function ( $wp_admin_bar ) { $wp_admin_bar->remove_node( ‘new-post’ ); }, 100 ); add_action( ‘admin_menu’, function () { remove_menu_page( ‘edit.php’ ); } );Continue reading