PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / admin / advanced-settings / includes / fields / datepicker-starts-monday.php

datepicker-starts-monday.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 4.0.3, at admin/advanced-settings/includes/fields/datepicker-starts-monday.php

30 lines 917 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if ( ! defined( 'ABSPATH' ) ) exit;
5
6 function wppb_toolbox_datepicker_starts_on_monday( $output, $form_location, $field, $user_id, $field_check_errors, $request_data ){
7 $field_id = $field['meta-name'];
8
9 $script = '<script>
10 jQuery(function(){
11 jQuery("#'. $field_id . '").each( function(){
12 var currentDatepicker = this;
13 jQuery( currentDatepicker ).datepicker("destroy");
14 jQuery( currentDatepicker ).datepicker({
15 inline: true,
16 changeYear: true,
17 changeMonth: true,
18 dateFormat: jQuery( currentDatepicker ).data("dateformat"),
19 firstDay: 1,
20 yearRange: "c-100:c+30"
21 });
22 });
23 });
24 </script>';
25
26 return $output . $script;
27 }
28 add_filter( 'wppb_output_form_field_datepicker', 'wppb_toolbox_datepicker_starts_on_monday', 20, 6 );
29 add_filter( 'wppb_admin_output_form_field_datepicker', 'wppb_toolbox_datepicker_starts_on_monday', 20, 6 );
30