Version Description
- May 5th 2018 =
Developer and deployment enhancements
- Added: .editorconfig file http://editorconfig.org/ #4571 (@JoryHogeveen)
- Updated: export-ignore list #4898 (@pglewis)
Bug Fixes
- Fixed: Pods Widget output #4891 (@pglewis)
- Fixed: Slider controls not showing #4895 (@pglewis)
- Fixed: Fatal exception attempting to parse Persian DateTime strings #4896 (@sc0ttkclark)
- Fixed: Array to string conversion notice in Pods form #4886 (@sc0ttkclark)
Download this release
Release Info
Developer | pglewis |
Plugin | Pods – Custom Content Types and Fields |
Version | 2.7.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.7.2 to 2.7.2.1
- classes/fields/datetime.php +55 -32
- classes/widgets/PodsWidgetField.php +6 -6
- classes/widgets/PodsWidgetForm.php +6 -6
- classes/widgets/PodsWidgetList.php +6 -6
- classes/widgets/PodsWidgetSingle.php +6 -6
- classes/widgets/PodsWidgetView.php +6 -6
- init.php +2 -2
- readme.txt +15 -1
- ui/fields/slider.php +30 -30
- ui/front/form.php +14 -5
classes/fields/datetime.php
CHANGED
@@ -400,6 +400,7 @@ class PodsField_DateTime extends PodsField {
|
|
400 |
if ( ! empty( $value ) && ! in_array( $value, array( '0000-00-00', '0000-00-00 00:00:00', '00:00:00' ), true ) ) {
|
401 |
// Try default storage format.
|
402 |
$date = $this->createFromFormat( static::$storage_format, (string) $value );
|
|
|
403 |
// Try field format.
|
404 |
$date_local = $this->createFromFormat( $format, (string) $value );
|
405 |
|
@@ -496,28 +497,36 @@ class PodsField_DateTime extends PodsField {
|
|
496 |
switch ( (string) pods_v( static::$type . '_time_type', $options, '12', true ) ) {
|
497 |
case '12':
|
498 |
$time_format = $this->get_time_formats( $js );
|
499 |
-
|
|
|
|
|
500 |
break;
|
501 |
case '24':
|
502 |
$time_format_24 = $this->get_time_formats_24( $js );
|
503 |
-
|
|
|
|
|
504 |
break;
|
505 |
case 'custom':
|
506 |
if ( ! $js ) {
|
507 |
$format = pods_v( static::$type . '_time_format_custom', $options, '' );
|
508 |
} else {
|
509 |
$format = pods_v( static::$type . '_time_format_custom_js', $options, '' );
|
|
|
510 |
if ( empty( $format ) ) {
|
511 |
$format = pods_v( static::$type . '_time_format_custom', $options, '' );
|
512 |
$format = $this->convert_format( $format, array( 'source' => 'php' ) );
|
513 |
}
|
514 |
}
|
|
|
515 |
break;
|
516 |
default:
|
517 |
$format = get_option( 'time_format' );
|
|
|
518 |
if ( $js ) {
|
519 |
$format = $this->convert_format( $format, array( 'source' => 'php' ) );
|
520 |
}
|
|
|
521 |
break;
|
522 |
}//end switch
|
523 |
|
@@ -551,11 +560,14 @@ class PodsField_DateTime extends PodsField {
|
|
551 |
'fjsy' => 'F jS, Y',
|
552 |
'y' => 'Y',
|
553 |
);
|
554 |
-
|
|
|
|
|
555 |
if ( $js ) {
|
556 |
// @todo Method parameters? (Not supported by array_map)
|
557 |
$date_format = array_map( array( $this, 'convert_format' ), $date_format );
|
558 |
-
|
|
|
559 |
}
|
560 |
|
561 |
return apply_filters( $filter, $date_format );
|
@@ -584,11 +596,14 @@ class PodsField_DateTime extends PodsField {
|
|
584 |
'hh_mm' => 'h:i',
|
585 |
'hh_mm_ss' => 'h:i:s',
|
586 |
);
|
587 |
-
|
|
|
|
|
588 |
if ( $js ) {
|
589 |
// @todo Method parameters? (Not supported by array_map)
|
590 |
$time_format = array_map( array( $this, 'convert_format' ), $time_format );
|
591 |
-
|
|
|
592 |
}
|
593 |
|
594 |
return apply_filters( $filter, $time_format );
|
@@ -609,10 +624,13 @@ class PodsField_DateTime extends PodsField {
|
|
609 |
'hh_mm' => 'H:i',
|
610 |
'hh_mm_ss' => 'H:i:s',
|
611 |
);
|
612 |
-
|
|
|
|
|
613 |
if ( $js ) {
|
614 |
// @todo Method parameters? (Not supported by array_map)
|
615 |
$time_format_24 = array_map( array( $this, 'convert_format' ), $time_format_24 );
|
|
|
616 |
$filter = 'pods_form_ui_field_time_js_formats_24';
|
617 |
}
|
618 |
|
@@ -632,41 +650,46 @@ class PodsField_DateTime extends PodsField {
|
|
632 |
|
633 |
$datetime = null;
|
634 |
|
635 |
-
|
636 |
-
|
|
|
637 |
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
|
642 |
-
|
643 |
-
|
644 |
|
645 |
-
|
646 |
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
|
651 |
-
|
652 |
-
|
|
|
653 |
}
|
654 |
-
}
|
655 |
-
}//end if
|
656 |
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
|
663 |
-
|
664 |
-
|
|
|
|
|
|
|
|
|
|
|
665 |
}
|
666 |
}
|
667 |
-
|
668 |
-
|
669 |
-
}
|
670 |
}
|
671 |
|
672 |
return apply_filters( 'pods_form_ui_field_datetime_formatter', $datetime, $format, $date );
|
400 |
if ( ! empty( $value ) && ! in_array( $value, array( '0000-00-00', '0000-00-00 00:00:00', '00:00:00' ), true ) ) {
|
401 |
// Try default storage format.
|
402 |
$date = $this->createFromFormat( static::$storage_format, (string) $value );
|
403 |
+
|
404 |
// Try field format.
|
405 |
$date_local = $this->createFromFormat( $format, (string) $value );
|
406 |
|
497 |
switch ( (string) pods_v( static::$type . '_time_type', $options, '12', true ) ) {
|
498 |
case '12':
|
499 |
$time_format = $this->get_time_formats( $js );
|
500 |
+
|
501 |
+
$format = $time_format[ pods_v( static::$type . '_time_format', $options, 'hh_mm', true ) ];
|
502 |
+
|
503 |
break;
|
504 |
case '24':
|
505 |
$time_format_24 = $this->get_time_formats_24( $js );
|
506 |
+
|
507 |
+
$format = $time_format_24[ pods_v( static::$type . '_time_format_24', $options, 'hh_mm', true ) ];
|
508 |
+
|
509 |
break;
|
510 |
case 'custom':
|
511 |
if ( ! $js ) {
|
512 |
$format = pods_v( static::$type . '_time_format_custom', $options, '' );
|
513 |
} else {
|
514 |
$format = pods_v( static::$type . '_time_format_custom_js', $options, '' );
|
515 |
+
|
516 |
if ( empty( $format ) ) {
|
517 |
$format = pods_v( static::$type . '_time_format_custom', $options, '' );
|
518 |
$format = $this->convert_format( $format, array( 'source' => 'php' ) );
|
519 |
}
|
520 |
}
|
521 |
+
|
522 |
break;
|
523 |
default:
|
524 |
$format = get_option( 'time_format' );
|
525 |
+
|
526 |
if ( $js ) {
|
527 |
$format = $this->convert_format( $format, array( 'source' => 'php' ) );
|
528 |
}
|
529 |
+
|
530 |
break;
|
531 |
}//end switch
|
532 |
|
560 |
'fjsy' => 'F jS, Y',
|
561 |
'y' => 'Y',
|
562 |
);
|
563 |
+
|
564 |
+
$filter = 'pods_form_ui_field_date_formats';
|
565 |
+
|
566 |
if ( $js ) {
|
567 |
// @todo Method parameters? (Not supported by array_map)
|
568 |
$date_format = array_map( array( $this, 'convert_format' ), $date_format );
|
569 |
+
|
570 |
+
$filter = 'pods_form_ui_field_date_js_formats';
|
571 |
}
|
572 |
|
573 |
return apply_filters( $filter, $date_format );
|
596 |
'hh_mm' => 'h:i',
|
597 |
'hh_mm_ss' => 'h:i:s',
|
598 |
);
|
599 |
+
|
600 |
+
$filter = 'pods_form_ui_field_time_formats';
|
601 |
+
|
602 |
if ( $js ) {
|
603 |
// @todo Method parameters? (Not supported by array_map)
|
604 |
$time_format = array_map( array( $this, 'convert_format' ), $time_format );
|
605 |
+
|
606 |
+
$filter = 'pods_form_ui_field_time_js_formats';
|
607 |
}
|
608 |
|
609 |
return apply_filters( $filter, $time_format );
|
624 |
'hh_mm' => 'H:i',
|
625 |
'hh_mm_ss' => 'H:i:s',
|
626 |
);
|
627 |
+
|
628 |
+
$filter = 'pods_form_ui_field_time_formats_24';
|
629 |
+
|
630 |
if ( $js ) {
|
631 |
// @todo Method parameters? (Not supported by array_map)
|
632 |
$time_format_24 = array_map( array( $this, 'convert_format' ), $time_format_24 );
|
633 |
+
|
634 |
$filter = 'pods_form_ui_field_time_js_formats_24';
|
635 |
}
|
636 |
|
650 |
|
651 |
$datetime = null;
|
652 |
|
653 |
+
try {
|
654 |
+
if ( method_exists( 'DateTime', 'createFromFormat' ) ) {
|
655 |
+
$timezone = get_option( 'timezone_string' );
|
656 |
|
657 |
+
if ( empty( $timezone ) ) {
|
658 |
+
$timezone = timezone_name_from_abbr( '', get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, 0 );
|
659 |
+
}
|
660 |
|
661 |
+
if ( ! empty( $timezone ) ) {
|
662 |
+
$datetimezone = new DateTimeZone( $timezone );
|
663 |
|
664 |
+
$datetime = DateTime::createFromFormat( $format, (string) $date, $datetimezone );
|
665 |
|
666 |
+
if ( false === $datetime ) {
|
667 |
+
$datetime = DateTime::createFromFormat( static::$storage_format, (string) $date, $datetimezone );
|
668 |
+
}
|
669 |
|
670 |
+
if ( false !== $datetime && $return_timestamp ) {
|
671 |
+
return $datetime;
|
672 |
+
}
|
673 |
}
|
674 |
+
}//end if
|
|
|
675 |
|
676 |
+
if ( in_array( $datetime, array( null, false ), true ) ) {
|
677 |
+
if ( empty( $date ) ) {
|
678 |
+
$timestamp = time();
|
679 |
+
} else {
|
680 |
+
$timestamp = strtotime( (string) $date );
|
681 |
|
682 |
+
if ( $return_timestamp ) {
|
683 |
+
return $timestamp;
|
684 |
+
}
|
685 |
+
}
|
686 |
+
|
687 |
+
if ( $timestamp ) {
|
688 |
+
$datetime = new DateTime( date_i18n( static::$storage_format, $timestamp ) );
|
689 |
}
|
690 |
}
|
691 |
+
} catch ( Exception $e ) {
|
692 |
+
// There is no saving this time value, it's an exception to the rule.
|
|
|
693 |
}
|
694 |
|
695 |
return apply_filters( 'pods_form_ui_field_datetime_formatter', $datetime, $format, $date );
|
classes/widgets/PodsWidgetField.php
CHANGED
@@ -23,13 +23,13 @@ class PodsWidgetField extends WP_Widget {
|
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
-
$before_widget = pods_v( 'before_widget', $
|
27 |
-
$after_widget = pods_v( 'after_widget', $
|
28 |
-
$before_title = pods_v( 'before_title', $
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
-
$after_title = pods_v( 'after_title', $
|
31 |
-
$before_content = pods_v( 'before_content', $
|
32 |
-
$after_content = pods_v( 'after_content', $
|
33 |
|
34 |
$args = array(
|
35 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
+
$before_widget = pods_v( 'before_widget', $args );
|
27 |
+
$after_widget = pods_v( 'after_widget', $args );
|
28 |
+
$before_title = pods_v( 'before_title', $args );
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
+
$after_title = pods_v( 'after_title', $args );
|
31 |
+
$before_content = pods_v( 'before_content', $args );
|
32 |
+
$after_content = pods_v( 'after_content', $args );
|
33 |
|
34 |
$args = array(
|
35 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
classes/widgets/PodsWidgetForm.php
CHANGED
@@ -23,13 +23,13 @@ class PodsWidgetForm extends WP_Widget {
|
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
-
$before_widget = pods_v( 'before_widget', $
|
27 |
-
$after_widget = pods_v( 'after_widget', $
|
28 |
-
$before_title = pods_v( 'before_title', $
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
-
$after_title = pods_v( 'after_title', $
|
31 |
-
$before_content = pods_v( 'before_content', $
|
32 |
-
$after_content = pods_v( 'after_content', $
|
33 |
|
34 |
$args = array(
|
35 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
+
$before_widget = pods_v( 'before_widget', $args );
|
27 |
+
$after_widget = pods_v( 'after_widget', $args );
|
28 |
+
$before_title = pods_v( 'before_title', $args );
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
+
$after_title = pods_v( 'after_title', $args );
|
31 |
+
$before_content = pods_v( 'before_content', $args );
|
32 |
+
$after_content = pods_v( 'after_content', $args );
|
33 |
|
34 |
$args = array(
|
35 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
classes/widgets/PodsWidgetList.php
CHANGED
@@ -23,13 +23,13 @@ class PodsWidgetList extends WP_Widget {
|
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
-
$before_widget = pods_v( 'before_widget', $
|
27 |
-
$after_widget = pods_v( 'after_widget', $
|
28 |
-
$before_title = pods_v( 'before_title', $
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
-
$after_title = pods_v( 'after_title', $
|
31 |
-
$before_content = pods_v( 'before_content', $
|
32 |
-
$after_content = pods_v( 'after_content', $
|
33 |
|
34 |
$args = array(
|
35 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
+
$before_widget = pods_v( 'before_widget', $args );
|
27 |
+
$after_widget = pods_v( 'after_widget', $args );
|
28 |
+
$before_title = pods_v( 'before_title', $args );
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
+
$after_title = pods_v( 'after_title', $args );
|
31 |
+
$before_content = pods_v( 'before_content', $args );
|
32 |
+
$after_content = pods_v( 'after_content', $args );
|
33 |
|
34 |
$args = array(
|
35 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
classes/widgets/PodsWidgetSingle.php
CHANGED
@@ -22,13 +22,13 @@ class PodsWidgetSingle extends WP_Widget {
|
|
22 |
public function widget( $args, $instance ) {
|
23 |
|
24 |
// Setup basic widget parameters.
|
25 |
-
$before_widget = pods_v( 'before_widget', $
|
26 |
-
$after_widget = pods_v( 'after_widget', $
|
27 |
-
$before_title = pods_v( 'before_title', $
|
28 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
29 |
-
$after_title = pods_v( 'after_title', $
|
30 |
-
$before_content = pods_v( 'before_content', $
|
31 |
-
$after_content = pods_v( 'after_content', $
|
32 |
|
33 |
$args = array(
|
34 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
22 |
public function widget( $args, $instance ) {
|
23 |
|
24 |
// Setup basic widget parameters.
|
25 |
+
$before_widget = pods_v( 'before_widget', $args );
|
26 |
+
$after_widget = pods_v( 'after_widget', $args );
|
27 |
+
$before_title = pods_v( 'before_title', $args );
|
28 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
29 |
+
$after_title = pods_v( 'after_title', $args );
|
30 |
+
$before_content = pods_v( 'before_content', $args );
|
31 |
+
$after_content = pods_v( 'after_content', $args );
|
32 |
|
33 |
$args = array(
|
34 |
'name' => trim( pods_v( 'pod_type', $instance, '' ) ),
|
classes/widgets/PodsWidgetView.php
CHANGED
@@ -23,13 +23,13 @@ class PodsWidgetView extends WP_Widget {
|
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
-
$before_widget = pods_v( 'before_widget', $
|
27 |
-
$after_widget = pods_v( 'after_widget', $
|
28 |
-
$before_title = pods_v( 'before_title', $
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
-
$after_title = pods_v( 'after_title', $
|
31 |
-
$before_content = pods_v( 'before_content', $
|
32 |
-
$after_content = pods_v( 'after_content', $
|
33 |
|
34 |
$args = array(
|
35 |
'view' => trim( pods_v( 'view', $instance, '' ) ),
|
23 |
public function widget( $args, $instance ) {
|
24 |
|
25 |
// Setup basic widget parameters.
|
26 |
+
$before_widget = pods_v( 'before_widget', $args );
|
27 |
+
$after_widget = pods_v( 'after_widget', $args );
|
28 |
+
$before_title = pods_v( 'before_title', $args );
|
29 |
$title = apply_filters( 'widget_title', pods_v( 'title', $instance ) );
|
30 |
+
$after_title = pods_v( 'after_title', $args );
|
31 |
+
$before_content = pods_v( 'before_content', $args );
|
32 |
+
$after_content = pods_v( 'after_content', $args );
|
33 |
|
34 |
$args = array(
|
35 |
'view' => trim( pods_v( 'view', $instance, '' ) ),
|
init.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Pods - Custom Content Types and Fields
|
4 |
Plugin URI: https://pods.io/
|
5 |
Description: Pods is a framework for creating, managing, and deploying customized content types and fields
|
6 |
-
Version: 2.7.2
|
7 |
Author: Pods Framework Team
|
8 |
Author URI: https://pods.io/about/
|
9 |
Text Domain: pods
|
@@ -36,7 +36,7 @@ if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) {
|
|
36 |
add_action( 'init', 'pods_deactivate_pods_ui' );
|
37 |
} else {
|
38 |
// Current version
|
39 |
-
define( 'PODS_VERSION', '2.7.2' );
|
40 |
|
41 |
// Version tracking between DB updates themselves
|
42 |
define( 'PODS_DB_VERSION', '2.3.5' );
|
3 |
Plugin Name: Pods - Custom Content Types and Fields
|
4 |
Plugin URI: https://pods.io/
|
5 |
Description: Pods is a framework for creating, managing, and deploying customized content types and fields
|
6 |
+
Version: 2.7.2.1
|
7 |
Author: Pods Framework Team
|
8 |
Author URI: https://pods.io/about/
|
9 |
Text Domain: pods
|
36 |
add_action( 'init', 'pods_deactivate_pods_ui' );
|
37 |
} else {
|
38 |
// Current version
|
39 |
+
define( 'PODS_VERSION', '2.7.2.1' );
|
40 |
|
41 |
// Version tracking between DB updates themselves
|
42 |
define( 'PODS_DB_VERSION', '2.3.5' );
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: pods, custom post types, custom taxonomies, content types, custom fields,
|
|
5 |
Requires at least: 4.5
|
6 |
Requires PHP: 5.3
|
7 |
Tested up to: 4.9.5
|
8 |
-
Stable tag: 2.7.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -180,6 +180,20 @@ We also have a dedicated [Slack Chat](https://pods.io/chat/) channel to help our
|
|
180 |
|
181 |
== Changelog ==
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
= 2.7.2 - May 3rd 2018 =
|
184 |
|
185 |
**New Features Added**
|
5 |
Requires at least: 4.5
|
6 |
Requires PHP: 5.3
|
7 |
Tested up to: 4.9.5
|
8 |
+
Stable tag: 2.7.2.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
180 |
|
181 |
== Changelog ==
|
182 |
|
183 |
+
= 2.7.2.1 - May 5th 2018 =
|
184 |
+
|
185 |
+
**Developer and deployment enhancements**
|
186 |
+
|
187 |
+
* Added: .editorconfig file [http://editorconfig.org/](http://editorconfig.org/) #4571 (@JoryHogeveen)
|
188 |
+
* Updated: export-ignore list #4898 (@pglewis)
|
189 |
+
|
190 |
+
**Bug Fixes**
|
191 |
+
|
192 |
+
* Fixed: Pods Widget output #4891 (@pglewis)
|
193 |
+
* Fixed: Slider controls not showing #4895 (@pglewis)
|
194 |
+
* Fixed: Fatal exception attempting to parse Persian DateTime strings #4896 (@sc0ttkclark)
|
195 |
+
* Fixed: Array to string conversion notice in Pods form #4886 (@sc0ttkclark)
|
196 |
+
|
197 |
= 2.7.2 - May 3rd 2018 =
|
198 |
|
199 |
**New Features Added**
|
ui/fields/slider.php
CHANGED
@@ -33,7 +33,7 @@ $attributes = PodsForm::merge_attributes( $attributes, $name, $form_fie
|
|
33 |
?>
|
34 |
<input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> />
|
35 |
|
36 |
-
<div class="pods-slider-field">
|
37 |
<div id="<?php echo esc_js( $attributes['id'] ); ?>-range" class="pods-slider-range"></div>
|
38 |
<div id="<?php echo esc_js( $attributes['id'] ); ?>-amount-display" class="pods-slider-field-display">
|
39 |
<?php echo $output_value; ?>
|
@@ -43,35 +43,35 @@ $attributes = PodsForm::merge_attributes( $attributes, $name, $form_fie
|
|
43 |
<script>
|
44 |
jQuery( function ( $ ) {
|
45 |
$( "#<?php echo esc_js( $attributes['id'] ); ?>-range" ).slider( {
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
} );
|
77 |
</script>
|
33 |
?>
|
34 |
<input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> />
|
35 |
|
36 |
+
<div class="pods-slider-field pods-compat-container">
|
37 |
<div id="<?php echo esc_js( $attributes['id'] ); ?>-range" class="pods-slider-range"></div>
|
38 |
<div id="<?php echo esc_js( $attributes['id'] ); ?>-amount-display" class="pods-slider-field-display">
|
39 |
<?php echo $output_value; ?>
|
43 |
<script>
|
44 |
jQuery( function ( $ ) {
|
45 |
$( "#<?php echo esc_js( $attributes['id'] ); ?>-range" ).slider( {
|
46 |
+
orientation : '<?php echo esc_js( pods_v( $form_field_type . '_orientation', $options, 'horizontal' ) ); ?>',
|
47 |
+
min : <?php echo esc_js( pods_v( $form_field_type . '_min', $options, 0 ) ); ?>,
|
48 |
+
max : <?php echo esc_js( pods_v( $form_field_type . '_max', $options, 100 ) ); ?>,
|
49 |
+
step : <?php echo esc_js( pods_v( $form_field_type . '_step', $options, 1 ) ); ?>,
|
50 |
|
51 |
+
<?php
|
52 |
+
if ( 1 == pods_var( $form_field_type . '_range', $options, 0 ) ) {
|
53 |
+
?>
|
54 |
+
range : true,
|
55 |
+
values : [
|
56 |
+
<?php echo esc_js( $values[0] ); ?>,
|
57 |
+
<?php echo esc_js( $values[1] ); ?>
|
58 |
+
],
|
59 |
+
slide : function ( event, ui ) {
|
60 |
+
$( "#<?php echo esc_js( $attributes['id'] ); ?>" ).val( ui.values[0] + ',' + ui.values[1] );
|
61 |
+
$( "#<?php echo esc_js( $attributes['id'] ); ?>-amount-display" ).html( ui.values[0] + ' - ' + ui.values[1] );
|
62 |
+
}
|
63 |
+
<?php
|
64 |
+
} else {
|
65 |
+
?>
|
66 |
+
range : false,
|
67 |
+
value : <?php echo esc_js( $value ); ?>,
|
68 |
+
slide : function ( event, ui ) {
|
69 |
+
$( "#<?php echo esc_js( $attributes['id'] ); ?>" ).val( ui.value );
|
70 |
+
$( "#<?php echo esc_js( $attributes['id'] ); ?>-amount-display" ).html( ui.value );
|
71 |
+
}
|
72 |
+
<?php
|
73 |
+
}//end if
|
74 |
+
?>
|
75 |
+
} );
|
76 |
} );
|
77 |
</script>
|
ui/front/form.php
CHANGED
@@ -108,17 +108,26 @@ do_action( 'pods_form_pre_fields', $fields, $pod, $params );
|
|
108 |
/**
|
109 |
* Runs before a field is outputted.
|
110 |
*
|
111 |
-
* @
|
112 |
-
* @
|
113 |
-
* @
|
114 |
-
* @
|
115 |
*
|
116 |
* @since 2.3.19
|
117 |
*/
|
118 |
do_action( 'pods_form_pre_field', $field, $fields, $pod, $params );
|
119 |
|
120 |
$default_class = ' pods-form-ui-row-type-' . $field[ 'type' ] . ' pods-form-ui-row-name-' . PodsForm::clean( $field[ 'name' ] );
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
?>
|
123 |
<li class="pods-field <?php echo esc_attr( $html_class, true ); ?>">
|
124 |
<div class="pods-field-label">
|
108 |
/**
|
109 |
* Runs before a field is outputted.
|
110 |
*
|
111 |
+
* @param array $field The current field.
|
112 |
+
* @param array $fields All fields of the form.
|
113 |
+
* @param object $pod The current Pod object.
|
114 |
+
* @param array $params The form's parameters.
|
115 |
*
|
116 |
* @since 2.3.19
|
117 |
*/
|
118 |
do_action( 'pods_form_pre_field', $field, $fields, $pod, $params );
|
119 |
|
120 |
$default_class = ' pods-form-ui-row-type-' . $field[ 'type' ] . ' pods-form-ui-row-name-' . PodsForm::clean( $field[ 'name' ] );
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Filter the html class used on form field list item element.
|
124 |
+
*
|
125 |
+
* @param string $html_class The HTML class.
|
126 |
+
* @param array $field The current field.
|
127 |
+
*
|
128 |
+
* @since 2.7.2
|
129 |
+
*/
|
130 |
+
$html_class = apply_filters( 'pods_form_html_class', 'pods-field-html-class', $field ) . $default_class;
|
131 |
?>
|
132 |
<li class="pods-field <?php echo esc_attr( $html_class, true ); ?>">
|
133 |
<div class="pods-field-label">
|