add_action( ‘init’, function () { global $wcvendors_pro; $wcv_pro_vendor_controller = $wcvendors_pro->wcvendors_pro_vendor_controller; remove_action(‘woocommerce_product_meta_start’, array( $wcv_pro_vendor_controller, ‘product_ships_from’ ), 9); add_action(‘woocommerce_product_meta_end’, array( $wcv_pro_vendor_controller, ‘product_ships_from’ ), 9); }, 100 );Continue reading
function create_toc($html) { $toc = ”; if (is_single()) { if (!$html) return $html; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’)); libxml_clear_errors(); $toc = ‘ Navigation rapide ‘; $h2_status = 0; $h3_status = 0; $i = 1; foreach($dom->getElementsByTagName(‘*’) as $element)…Continue reading
function create_toc($html) { $toc = ”; if (is_single()) { if (!$html) return $html; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’)); libxml_clear_errors(); $toc = ‘ Navigation rapide ‘; $h2_status = 0; $h3_status = 0; $i = 1; foreach($dom->getElementsByTagName(‘*’) as $element)…Continue reading
add_filter( ‘login_errors’, function ( $error ) { // Edit the line below to customize the message. return ‘Something is wrong!’; } );Continue reading
global $wpdb; $args = array( ‘post_type’ => ‘product’, ‘product_tag’ => ‘top-products’, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘top_product_page_order’, ‘order’ => ‘ASC’ ); $loop = new WP_Query($args); $product_count = $loop->post_count; if ($product_count > 0) { echo ‘ ‘; // Start the loop…Continue reading
echo do_shortcode(“[Woo_stamped_io type=’badge’ product_id=’ . esc_attr($product->get_id()) . ‘]”);Continue reading
add_filter( /** * Filter the autoresponder content * this can be used to add custom shortcodes * * @param $msg * @param $id * @param $payment * * @return string content for autoresponder */ ‘qem_autoresponder-message-content’, function ( $msg, $id, $payment…Continue reading
function custom_voucher_discount_type( $discount, $discounting_amount, $cart_item, $single, $coupon ) { global $wpdb; // Check if the coupon is a wc_voucher $voucher_post_id = $wpdb->get_var($wpdb->prepare( “SELECT ID FROM {$wpdb->posts} WHERE post_title = %s AND post_type = ‘wc_voucher’”, $coupon->get_code() )); if ( $voucher_post_id )…Continue reading
/** * verifica se o cpf informado é valido */ function jet_fb_v_validacpf( $value, $context ): bool { $fields = jet_fb_request_handler()->get_request(); // Extrai somente os números $cpf = preg_replace( ‘/[^0-9]/is’, ”, $fields[‘cpf’] ); // Verifica se foi informado todos os digitos…Continue reading
use Jet_Form_Builder\Exceptions\Action_Exception; add_action( ‘jet-form-builder/custom-action/uniquecpf’, function ( $request, $handler ) { $usuario_atual_id = get_current_user_id(); // Verificar se o usuário atual está logado e tem o mesmo CPF if ($usuario_atual_id && get_user_meta($usuario_atual_id, ‘jet_user_cpf’, true) === $request[‘cpf’]) { // Pula a validação se…Continue reading