/* Plugin Name: Purge Cache Description: Adds a button to the WordPress dashboard to clear the object cache */ add_action( ‘admin_bar_menu’, ‘add_purge_cache_button’, 999 ); function add_purge_cache_button( $wp_admin_bar ) { if ( ! current_user_can( ‘manage_options’ ) ) { return; } $args…Continue reading
/** * Disable the email address suggestion. * * @link https://wpforms.com/developers/how-to-disable-the-email-suggestion-on-the-email-form-field/ * * For support, please visit: https://www.facebook.com/groups/wpformsvip */ add_filter( ‘wpforms_mailcheck_enabled’, ‘__return_false’ );Continue reading
/** * WPForms Add new address field scheme (Canada) * * @link https://wpforms.com/developers/create-additional-schemes-for-the-address-field/ * * For support, please visit: https://www.facebook.com/groups/wpformsvip */ function wpf_dev_new_address_scheme( $schemes ) { $schemes[ ‘canada’ ] = array( ‘label’ => ‘Canada’, ‘address1_label’ => ‘Address Line 1’, ‘address2_label’…Continue reading
add_action( ‘woocommerce_product_options_advanced’, ‘add_is_hidden_for_anonymous_field’ ); function add_is_hidden_for_anonymous_field() { $args = array( ‘id’ => ‘is_hidden_for_anonymous’, ‘label’ => ‘Hide products for non-authorize users’, ); woocommerce_wp_checkbox( $args ); } add_action( ‘woocommerce_process_product_meta’, ‘save_is_hidden_for_anonymous_field’ ); function save_is_hidden_for_anonymous_field( $post_id ) { $product = wc_get_product( $post_id ); $value…Continue reading
// Función que maneja la petición AJAX function load_shortcode_content() { $mapa_id = $_REQUEST[‘mapa_id’]; echo do_shortcode(‘[display-frm-data id=96 filter=limited mapa_id=”‘ . $mapa_id . ‘”]’); wp_die(); } add_action(‘wp_ajax_load_shortcode_content’, ‘load_shortcode_content’); // Si el usuario está logueado add_action(‘wp_ajax_nopriv_load_shortcode_content’, ‘load_shortcode_content’); // Si el usuario no está…Continue reading
function enqueue_admin_ajax() { // Aquí no estamos encolando un archivo js específico, sólo pasando datos a JavaScript wp_localize_script(‘jquery’, ‘myAjax’, array( // ‘jquery’ porque sabemos que jQuery ya está cargado en muchos temas ‘ajaxurl’ => admin_url(‘admin-ajax.php’) )); } add_action(‘wp_enqueue_scripts’, ‘enqueue_admin_ajax’);Continue reading
add_action(‘frm_after_create_entry’, ‘copy_into_my_table’, 20, 2); function copy_into_my_table($entry_id, $form_id){ if($form_id == 2){ $data = (object)$_POST; $geoJSON = $data->item_meta[‘8′]; $rounded_area = $data->item_meta[’26’]; $tam_entry_id = $data->item_meta[‘9’]; global $postgis; if (!$postgis) { error_log(“Error: No se pudo establecer una conexión con la base de datos.”); return;…Continue reading
/** * @link https://library.wpcode.com/snippet/924r645g/ */ add_filter( ‘simpay_get_customer_args_from_payment_form_request’, /** * @param array $customer_args Arguments for Customer. * @param \SimplePay\Core\Abstracts\Form $form Form instance. * @param array $deprecated Empty array. * @param array $form_values Values of named fields in the payment form. *…Continue reading
add_filter( ‘wpcode_snippet_output_js’, function( $code ) { $code = str_replace( ‘’, ”, $code ); return $code; });Continue reading