custom-login-logo-style
// custom login logo function injection function center_login_logo() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
// custom login logo function injection function center_login_logo() { ?>Continue reading
/** * v1.0.1 * Block Search Engine Bots from Accessing GeoIP Detection AJAX * * Add this code to your theme’s functions.php or a custom plugin */ add_action(‘init’, ‘block_bots_from_geoip_detection’); function block_bots_from_geoip_detection() { // Only check on admin-ajax.php requests if (strpos($_SERVER[‘REQUEST_URI’],…Continue reading
/** * Snippet Name: Show ‘NEW’ Badges for Recently Added Items in WooCommerce * Snippet Author: wdxtechnologies.com */ // Show the NEW badge on the archive loop item add_action( ‘woocommerce_after_shop_loop_item_title’, ‘ecommercehints_product_archive_new_badge’, 1 ); function ecommercehints_product_archive_new_badge() { global $product; $days_to_show =…Continue reading
// Ajoutez ce code dans WPCode ou dans le fichier functions.php de votre thème enfant add_action(‘wp_head’, function() { ?>Continue reading
// Modify the columns and ensure WhatsApp column appears last function add_whatsapp_column($columns) { // Remove WhatsApp column if it already exists if (isset($columns[‘whatsapp’])) { unset($columns[‘whatsapp’]); } // Add WhatsApp column after Courier Address column if (isset($columns[‘courier_address’])) { $new_columns = [];…Continue reading
// Add the new column to the orders page add_filter(‘manage_edit-shop_order_columns’, ‘display_courier_address_column’); // Display data in the new column add_action(‘manage_shop_order_posts_custom_column’, ‘display_courier_address_data’, 10, 2); function display_courier_address_column($columns) { // Add the new column with a proper name $columns[‘courier_address’] = ‘Courier Address’; return $columns;…Continue reading
add_action(‘woocommerce_subscription_status_active’, ‘send_admin_subscription_reactivated_email’, 10, 1); function send_admin_subscription_reactivated_email($subscription) { // Get the WooCommerce mailer $mailer = WC()->mailer(); // Get the email template content ob_start(); wc_get_template( ’emails/admin-subscription-reactivated.php’, // Your custom template file array( ‘subscription’ => $subscription, ’email_heading’ => ‘Subscription Reactivated’, ‘sent_to_admin’ => true,…Continue reading
/** * Function to track search engine bots and create admin page * v0.04 */ // Create database table when the snippet is activated function create_bot_tracker_table() { global $wpdb; $table_name = $wpdb->prefix . ‘bot_tracker’; $charset_collate = $wpdb->get_charset_collate(); $sql = “CREATE…Continue reading
add_action(‘mepr-event-subscription-stopped’, function($event) { $subscription = $event->get_data(); $user = $subscription->user(); $wp_user = get_user_by(‘id’, $user->ID); if(!$wp_user) { return; } // Remove role $wp_user->remove_role( ‘subscriber’ ); // Add role $wp_user->add_role( ‘editor’ ); });Continue reading
// allow Editors to access Memberpress function add_memberpress(){ $role = get_role(‘editor’); $role->add_cap(‘remove_users’); } add_action(‘admin_init’,’add_memberpress’);Continue reading