This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_new_rss_fields() { | |
global $post; | |
if(has_post_thumbnail($post->ID)) { | |
$thumbnail = get_attachment_link(get_post_thumbnail_id($post->ID)); | |
echo"\t<image>{$thumbnail}</image>\n"; | |
} | |
$published_date = get_the_date( 'm/d/Y', $post->ID ); | |
echo"\t<publishedDate>{$published_date}</publishedDate>\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wpforms_wp_footer_end', function() { ?> | |
<script type="text/javascript"> | |
;(function($) { | |
if( $('#wpforms-101')) { | |
$("#wpforms-101-field_5").on("input", function(){ | |
var the_date = new Date($(this).val()); | |
the_date.setDate(the_date.getDate() + 1); | |
$('#wpforms-740-field_25').val( the_date.toLocaleDateString('en-US') ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wpforms_wp_footer_end', function () { | |
?> | |
<script type="text/javascript"> | |
jQuery(function($){ | |
// This array contains all the options that will be disabled | |
// 2217 is the form ID | |
// 1, 2, 3 after #wpforms-2217-field_ are the field IDs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// NOTE: This snippet is not perfect because it will not check for validations of the current page just like clicking the next button does | |
add_action( 'wpforms_wp_footer_end', function() { | |
?> | |
<style> | |
.wpforms-page-indicator-page-number { | |
transition: all 0.2s ease-in-out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wpforms_process_validate_name', function( $field_id, $field_submit, $form_data ) { | |
// Bail early if form ID is not 2090 and field ID is not 1 | |
if ( absint( $form_data['id'] ) !== 2090 && $field_id !== 1 ) { | |
return; | |
} | |
$submitted_name = $field_submit['first'] .' ' .$field_submit['last']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wpforms_process_validate_text', function( $field_id, $field_submit, $form_data ) { | |
// Optional, you can limit to specific forms. Below, we restrict output to | |
// form ID #2056 and field ID #5 | |
if ( absint( $form_data['id'] ) !== 2056 && $field_id !== 5 ) { | |
return; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Make sure to turn the WordPress debug mode | |
// https://wordpress.org/plugins/wp-debugging/ | |
add_action( 'wpforms_process_complete', function( $fields, $entry, $form_data, $entry_id ) { | |
error_log( var_export( $form_data, true ) ); | |
}, 10, 4 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpforms_field_data', ( $field, $form_data ) { | |
if ( absint( $form_data['id'] ) !== 2067 || absint( $field['id'] ) !== 5 ) { | |
return $field; | |
} | |
$default_field_value = 'Second Choice'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wpforms_wp_footer_end', function() { ?> | |
<script type="text/javascript"> | |
;(function($) { | |
$( "#wpforms-form-41 .wpforms-field-radio li" ).on( "click", function() { | |
$(this).closest('.wpforms-page').find('.wpforms-page-next').click(); | |
}); | |
})(jQuery); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function restrict_letters_in_phone_field( ) { | |
?> | |
<script type="text/javascript"> | |
;(function($) { | |
$('.wpforms-field-phone input').bind('input', function() { | |
var c = this.selectionStart, | |
r = /^[A-Za-z]+$/, | |
v = $(this).val(); |
NewerOlder