function get_related_review_field( $atts ) { $atts = shortcode_atts( [ ‘review_field’ => ”, ‘relation_field’ => ‘related_review’, ‘post_id’ => null, ], $atts ); // Get the current post ID, even inside Elementor Loop $post_id = $atts[‘post_id’] ? $atts[‘post_id’] : get_queried_object_id(); if (…Continue reading
add_filter( ‘edd_gateway_supports’, ‘prefix_maybe_add_mixed_cart_support’, 999, 2 ); /** * Allow Stripe to support mixed carts. * Requires EDD 3.2.7. */ function prefix_maybe_add_mixed_cart_support( $supports, $gateway ) { if ( ‘stripe’ === $gateway ) { $supports[] = ‘mixed_cart’; } return $supports; }Continue reading
/*hide buttons when the Enable Classic Editor toggle is ENABLED*/ add_action(‘admin_head’, ‘pa_hide_standard_editor_button’); function pa_hide_standard_editor_button() { echo ‘ ‘; } /*hide buttons when Enable Classic Editor toggle is DISABLED*/ add_action(‘admin_head’, ‘pa_hide_default_editor_button’); function pa_hide_default_editor_button() { echo ‘ ‘; }Continue reading
function salient_redux_custom_fonts() { return array( ‘Custom Fonts’ => array( ‘PP Formula Extended Medium’ => ‘PP Formula Extended Medium’ ) ); } add_filter( “redux/salient_redux/field/typography/custom_fonts”, “salient_redux_custom_fonts” );Continue reading
function fc_recalcular_slugs_product_cat() { $terms = get_terms([ ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => false, ]); foreach ($terms as $term) { $slug_parts = []; // Recorrer jerarquía hacia arriba $parent_id = $term->parent; while ($parent_id != 0) { $parent = get_term($parent_id, ‘product_cat’); if (is_wp_error($parent)…Continue reading
// // Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, function ( $post_id ) { // Check if user has the capability to delete products if ( !current_user_can( ‘delete_products’ ) ) { return; } $product = wc_get_product( $post_id…Continue reading
//* Hacemos que automáticamente se seleccionen los términos padre al guardar add_action(‘save_post’, function ($post_id, $post){ $arrayPostTypeAllowed = array(‘product’); $arrayTermsAllowed = array(‘product_cat’); if(!in_array($post->post_type, $arrayPostTypeAllowed)){ return $post_id; }else{ foreach($arrayTermsAllowed as $t_name){ $terms = wp_get_post_terms($post_id, $t_name ); foreach($terms as $term){ while($term->parent != 0…Continue reading
// Desactivamos la opción de IA de Elementor add_filter(‘get_user_option_’ . Elementor\Modules\Ai\Preferences::ENABLE_AI, ‘__return_null’);Continue reading