Untitled Snippet

function force_login() { if ( ! is_user_logged_in() { wp_redirect( ‘http://wp-login’ ); exit(); } } add_action( ‘template_redirect’, ‘force_login’ );Continue reading

Remove Customizer from Admin Menu and Admin Bar

add_action( ‘admin_menu’, function() { global $current_user; $current_user = wp_get_current_user(); $user_name = $current_user->user_login; //check condition for the user means show menu for this user if(is_admin() && $user_name != ‘USERNAME’) { //We need this because the submenu’s link (key from the array…Continue reading

Add Featured Images to RSS Feeds

/** * Add the post thumbnail, if available, before the content in feeds. * * @param string $content The post content. * * @return string */ function wpcode_snippet_rss_post_thumbnail( $content ) { global $post; if ( has_post_thumbnail( $post->ID ) ) {…Continue reading

Untitled Snippet

add_filter( ‘woocommerce_product_add_to_cart_text’, ‘fmd_change_select_options_button_text’, 10, 2 ); if(!function_exists(“fmd_change_select_options_button_text”)) { function fmd_change_select_options_button_text( $label, $product ) { if ( $product->is_type( ‘variable’ ) ) { return ‘Comprar ahora’; } return $label; } }Continue reading

mlm

— phpMyAdmin SQL Dump — version 5.0.2 — https://www.phpmyadmin.net/ — — Host: localhost — Generation Time: Nov 20, 2021 at 08:35 AM — Server version: 10.4.13-MariaDB — PHP Version: 7.2.32 SET SQL_MODE = “NO_AUTO_VALUE_ON_ZERO”; START TRANSACTION; SET time_zone = “+00:00”;…Continue reading