This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpc_block_emails_on_form_submission( $result, $value, $form, $field ) { | |
// Ensure the field is an email type and the value is a valid string | |
if ( $field->type === 'email' && is_string( $value ) && ! empty( $value ) ) { | |
// List of blocked emails (can be modified via a filter) | |
$blocked_emails = apply_filters( 'wpc_blocked_emails', [ '[email protected]' ] ); | |
// Normalize the email (trim spaces and convert to lowercase) | |
$email = mb_strtolower( trim( $value ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpc_block_emails_on_all_forms($result, $value, $form, $field) { | |
// Check if this is an e-mail field | |
if ($field->type === 'email') { | |
// List of e-mails to block | |
$blocked_emails = ['[email protected]', '[email protected]']; | |
// Standardize email format to avoid variations | |
if (in_array(strtolower(trim($value)), $blocked_emails)) { | |
$result['is_valid'] = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('wp/wp-load.php'); | |
// Set the path to the CSV file | |
$file_path = 'brands.csv'; | |
// Open the CSV file | |
if (($handle = fopen($file_path, 'r')) !== FALSE) { | |
// Loop through each row in the CSV file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once( 'wp/wp-load.php' ); | |
// Set the path to the CSV file | |
$file_path = 'products_images.csv'; | |
$count = 0; | |
$csv_data = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('wp/wp-load.php'); | |
// Set the path to the CSV file | |
$file_path = 'products.csv'; | |
$count = 0; | |
$csv_data = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (!defined('ABSPATH')) die('Restricted Area'); | |
/* | |
* Plugin Name: Gravity Forms Enhancements | |
* Description: Tweaks for Gravity Forms plugin. | |
* Version: 20191102 | |
* Author: Aurélien Denis | |
* Author URI: https://wpchannel.com/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$queried_object = get_queried_object(); | |
$taxonomy = $queried_object->taxonomy; | |
$term_id = $queried_object->term_id; | |
$taxonomy_name = 'category'; | |
$term_children = get_term_children($term_id, $taxonomy_name); | |
echo '<ul class="nav nav-pills">'; | |
foreach ($term_children as $child) { | |
$term = get_term_by('id', $child, $taxonomy_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Disable WooCommerce.com Account Notice */ | |
add_filter('woocommerce_helper_suppress_admin_notices', '__return_true'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Disable User Password Change Notification */ | |
add_filter('send_password_change_email', '__return_false'); | |
/* Disable Admin Password Change Notification */ | |
remove_action('after_password_reset', 'wp_password_change_notification'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpc_dequeue_woocommerce_styles_scripts() { | |
if (function_exists('is_woocommerce')) { | |
if (! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page()) { | |
wp_dequeue_style('woocommerce-general'); | |
wp_dequeue_style('woocommerce-layout'); | |
wp_dequeue_style('woocommerce-smallscreen'); | |
wp_dequeue_script('wc_price_slider'); | |
wp_dequeue_script('wc-single-product'); | |
wp_dequeue_script('wc-add-to-cart'); |
NewerOlder