wpforms_display( $form_id=562, $title=true, $desc=true);
Where 512
is the form ID
, $title
- form title and $desc
- description.
<ul> | |
<?php | |
// Check if there are posts | |
if ( have_posts() ) : while ( have_posts() ) : the_post(); | |
// Get attachments for the current post | |
$attachments = get_posts( array( | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'post_status' => null, |
<?php | |
/** | |
* The wpforms_process_filter hook is used to modify the form submission data. | |
* @link https://wpforms.com/developers/wpforms_process_filter/ | |
**/ | |
add_filter( 'wpforms_process_filter', function ( $fields, $entry, $form_data ) { | |
foreach ( $fields as &$field ) { | |
// If field type is phone | |
if ( $field['type'] == 'phone' ) { | |
// Grabing the field value |
<?php | |
/** | |
* Wordpress cron: Unschedule the wpforms_email_summaries_cron events when WPForms is deactivated | |
* @link https://developer.wordpress.org/reference/functions/wp_unschedule_event/ | |
* @link https://developer.wordpress.org/reference/functions/wp_next_scheduled/ | |
* @link https://wpforms.com/docs/how-to-use-email-summaries/ | |
* @link https://developer.wordpress.org/reference/functions/get_option/ | |
* */ | |
$crons = get_option( 'cron' ); |
<?php | |
add_filter( 'wpforms_process_redirect_url', function( $url, $form_id, $fields ) { | |
$args = array(); | |
foreach( $fields as $field ) { | |
if( !empty( $field['value'] ) ) | |
$args[$field['name'] .'_'. $field['id']] = $field['value']; | |
} | |
return esc_url_raw( add_query_arg( $args, $url ) ); | |
}, 10, 3 ); |
<?php | |
/** | |
Wordpress login url change using login_url @link https://developer.wordpress.org/reference/hooks/login_url/ | |
*/ | |
add_filter( 'login_url', function( $login_url, $redirect, $force_reauth ){ | |
// Change here your login page url | |
$login_url = 'yoursite_login_url'; | |
if ( ! empty( $redirect ) ) { | |
$login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url ); | |
} |
<?php | |
/** | |
* How to exclude certain fields from saving to database, | |
* */ | |
add_filter( 'wpforms_entry_save_data', static function( $fields, $entry, $form_data ) { | |
//where 11 is the Form ID @link: https://wpforms.com/developers/how-to-locate-form-id-and-field-id/#form-id | |
if ( '11' !== $form_data['id'] ) { | |
return $fields; | |
} | |
//where 1, and 7 are the Field IDs @link: https://wpforms.com/developers/how-to-locate-form-id-and-field-id/#field-id |
<?php | |
/** | |
* @link https://developer.wordpress.org/reference/hooks/after_password_reset/ | |
* @link https://wpforms.com/how-to-create-a-custom-login-form-for-improved-site-branding/#Step_4_Add_a_Forgot_Password_Link_to_Your_Custom_Login_Form | |
*/ | |
add_action( 'after_password_reset', function( $user_id ){ | |
exit( wp_redirect( home_url('/login/') ) ); | |
}, 8, 1 ); |
.flatpickr-current-month .flatpickr-monthDropdown-months { | |
width: auto !important; | |
display: inline-block !important; | |
padding: 0 0 0 .5ch !important; | |
margin: 0px !important; | |
} | |
.flatpickr-current-month input.cur-year { | |
padding: 0 0 0 .5ch !important; | |
margin: 0px !important; |
wpforms_display( $form_id=562, $title=true, $desc=true);
Where 512
is the form ID
, $title
- form title and $desc
- description.