// Agregar un shortcode para el botón function onesignal_register_button() { if (is_user_logged_in()) { $current_user = wp_get_current_user(); $email = $current_user->user_email; // Botón que llama a la función de registro en OneSignal mediante AJAX return ‘ Recibir notificaciones ‘; } else {…Continue reading
/** * Snippet Name: Add the Buy on Kindle button near Add to Cart in WooCommerce PDP. */ add_action(‘woocommerce_after_add_to_cart_button’,’add_kindle_button’); function add_kindle_button() { $kindle_button_url = get_post_meta( get_the_ID(),’kindle_button_url’,true); if ( isset($kindle_button_url) && filter_var($kindle_button_url, FILTER_VALIDATE_URL)) { $style = ‘style=”background-color: #ff9900; color: #fff;’; $button…Continue reading
function add_custom_div(){ // add your custom code here to do something echo ‘ ‘; echo ‘ ‘; } add_action( ‘wp_footer’, ‘add_custom_div’ ); function snow_js() { ?>Continue reading
/** * Custom shortcode to display the total number of entries for a form. * * Basic usage: [wpf_entries_count id=”FORMID” type=”TYPE”] * * Realtime counts could be delayed due to any caching setup on the site * * @link https://wpforms.com/developers/how-to-display-the-total-number-of-entries/…Continue reading
/** * Add additional formats for the Time field Format dropdown using French time format. * * @link https://wpforms.com/developers/how-to-create-additional-formats-for-the-date-time-field-time-picker/ */ function wpf_dev_date_field_time_formats_french( $time_formats ) { $time_formats[ ‘G\\\hi\\\m’ ] = ‘French Format’; return $time_formats; } add_filter( ‘wpforms_datetime_time_formats’, ‘wpf_dev_date_field_time_formats_french’, 10, 1 );Continue reading
/** * Add additional formats for the Time field Format dropdown. * * @link https://wpforms.com/developers/how-to-create-additional-formats-for-the-date-time-field-time-picker/ */ function wpf_dev_date_field_time_formats1 ( $time_formats ) { // Displays 2-digit hour, 2-digit minute, and 2-digit seconds $time_formats[ ‘H:i:s’ ] = ‘HH:MM:SS’; return $time_formats; } add_filter(…Continue reading
/** * Customize email field properties. * * @link https://wpforms.com/developers/how-to-change-sublabels-for-the-email-field/ */ function wpf_dev_email_field_properties( $properties, $field, $form_data ) { // Only process this snippet on the form ID 123 if ( absint( $form_data[ ‘id’ ] ) !== 123 ) { return…Continue reading
/** * Customize email field properties. * * @link https://wpforms.com/developers/how-to-change-sublabels-for-the-email-field/ */ function wpf_dev_email_field_properties( $properties, $field, $form_data ) { // Change sublabel values $properties[ ‘inputs’ ][ ‘primary’ ][ ‘sublabel’ ][ ‘value’ ] = __( ‘Enter Your Email’, ‘plugin-domain’ ); $properties[ ‘inputs’…Continue reading
/* WCV – Require auction start price and auction dates */ function wcv_make_field_required( $field ) { $field[‘custom_attributes’][‘required’] = ‘required’; $field[‘custom_attributes’][‘data-parsley-required-message’] = __( ‘This field is required.’, ‘wc-vendors’ ); return $field; } add_filter( ‘wcv_simple_auctions_end_date’, ‘wcv_make_field_required’ ); add_filter( ‘wcv_simple_auctions_start_date’, ‘wcv_make_field_required’ ); add_filter(…Continue reading