Untitled Snippet
function force_login() { if ( ! is_user_logged_in() { wp_redirect( ‘http://wp-login’ ); exit(); } } add_action( ‘template_redirect’, ‘force_login’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
function force_login() { if ( ! is_user_logged_in() { wp_redirect( ‘http://wp-login’ ); exit(); } } add_action( ‘template_redirect’, ‘force_login’ );Continue reading
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_filter( ‘aioseo_woocommerce_product_attributes’, ‘__return_true’ );Continue reading
/** * Gravity Wiz // Gravity Forms // Unrequire Required Fields for Testing * * When bugs pop up on your forms, it can be really annoying to have to fill out all the required fields for every test *…Continue reading
// Add custom css: quick buttons and accordion at the top of the GravityWP – CSS Selector modal function my_custom_gwp_css_selector_add_css() { $html .= “ Custom CSS Section Font Smaller (90%) Section Font Smaller (75%) Gravity PDF GravityPDF Page Break GravityPDF…Continue reading
/** * Credit Card Expiration Field on Cambridge Caregivers Engagement Form year dropdown set to current year and +10 years from now */ add_filter(‘gform_date_min_year’, function ($min_year, $form, $field) { return $form[‘id’] == 1 && $field->id == 172 ? date(‘Y’) :…Continue reading
/** * 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
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
/** * Wrap the thumbnail in a link to the post. * Only use this if your theme doesn’t already wrap thumbnails in a link. * * @param string $html The thumbnail HTML to wrap in an anchor. * @param…Continue reading
— 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