// 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
//* Add Excerpt support to Pages in Genesis add_post_type_support( ‘page’, ‘excerpt’ );Continue reading
// Schedule daily cron jobs for upcoming and past events if (!wp_next_scheduled(‘update_upcoming_events_cron_hook’)) { wp_schedule_event(time(), ‘daily’, ‘update_upcoming_events_cron_hook’); } if (!wp_next_scheduled(‘update_past_events_cron_hook’)) { wp_schedule_event(time() + 60, ‘daily’, ‘update_past_events_cron_hook’); } // Attach functions to the cron hooks add_action(‘update_upcoming_events_cron_hook’, ‘update_upcoming_events_cron_function’); add_action(‘update_past_events_cron_hook’, ‘update_past_events_cron_function’); // Add a…Continue reading
add_action( ‘shutdown’, ‘advads_schedule_order_notes_to_set_actions_run’ ); /** * Schedule the order notes to set actions run cron event. * * @return void */ function prefix_schedule_order_notes_to_set_actions_run() { // This option is added when no more notes can be found. if ( get_option( ‘prefix_use_order_notes_to_set_actions_run’…Continue reading