use Elementor\Controls_Manager; use Elementor\Group_Control_Background; function add_background_and_overlay_to_layout_tab($element, $args) { // === NORMAL BACKGROUND === $element->start_controls_section( ‘custom_background_layout’, [ ‘label’ => __(‘Background (Layout Tab)’, ‘textdomain’), ‘tab’ => Controls_Manager::TAB_LAYOUT, ] ); $element->add_group_control( Group_Control_Background::get_type(), [ ‘name’ => ‘custom_background’, ‘label’ => __(‘Background’, ‘textdomain’), ‘types’ => [‘classic’,…Continue reading
/** * Protect Elementor Forms */ add_action( ‘elementor_pro/forms/validation/email’, function( $field, $record, $ajax_handler ) { // validate email format if ( ! is_email( $field[‘value’] ) ) { $ajax_handler->add_error( $field[‘id’], ‘Invalid Email address, it must be in the format [email protected]’ ); return;…Continue reading
// Prevent new plugin installations but allow updates to existing plugins add_filter(‘user_has_cap’, ‘prevent_plugin_installation_for_all_users’, 10, 4); function prevent_plugin_installation_for_all_users($allcaps, $cap, $args, $user) { // Prevent plugin installation for all users if (isset($args[0]) && $args[0] === ‘install_plugins’) { $allcaps[$cap[0]] = false; } //…Continue reading
/** * Blueprints — dynamic archive title shortcode for Avada Layout H1 * Usage: [bp_archive_title] in the Avada Title element, set to H1. * by DC@CC 19/08/26 */ add_shortcode( ‘bp_archive_title’, function() { if ( is_category() || is_tag() || is_tax() )…Continue reading
function pm_hide_customer_profile_notes_on_add_user( $match, $rule, $screen, $field_group ) { if ( ! $match || ‘user_form’ !== $rule[‘param’] || empty( $screen[‘user_form’] ) || ‘add’ !== $screen[‘user_form’] || ! function_exists( ‘acf_get_field’ ) ) { return $match; } static $customer_profile_notes_parent = null; if (…Continue reading
function rd_aw_register_delete_custom_field_actions() { if ( ! class_exists( ‘\AutomateWoo\Action’ ) ) { return; } if ( ! class_exists( ‘RD_AW_Action_Delete_Custom_Field_Base’, false ) ) { abstract class RD_AW_Action_Delete_Custom_Field_Base extends \AutomateWoo\Action { public function load_fields() { $meta_key = ( new \AutomateWoo\Fields\Text() ) ->set_name( ‘meta_key’…Continue reading
if ( ! defined( ‘ABSPATH’ ) ) { return; } if ( ! class_exists( ‘WooCommerce’ ) ) { return; } if ( ! function_exists( ‘wcs_get_subscription’ ) ) { return; } function pm_exclude_blacklist_suspect_meta_from_subscription_data( $data ) { if ( ! is_array( $data…Continue reading
function rd_refund_button_has_transaction_id( $order ) { return $order instanceof WC_Order && ” !== trim( (string) $order->get_transaction_id() ); } function rd_refund_button_should_be_hidden( $order ) { return $order instanceof WC_Order && ! rd_refund_button_has_transaction_id( $order ) && $order->has_status( array( ‘new’, ‘auto-draft’, ‘draft’, ‘checkout-draft’, ‘pending’, ‘failed’,…Continue reading