@@ -255,7 +255,6 @@ |
||
| 255 | 255 | * Get the default date format for a field based on the field ID and the time format setting |
| 256 | 256 | * |
| 257 | 257 | * @since 1.14 |
| 258 | - |
|
| 259 | 258 | * @param string $time_format The time format ("12" or "24"). Default: "12" {@since 1.14} |
| 260 | 259 | * @param int $field_id The ID of the field. Used to figure out full time/hours/minutes/am/pm {@since 1.14} |
| 261 | 260 | * |
@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * GravityView Defining Post Types and Rewrite rules |
|
| 4 | - * |
|
| 5 | - * @package GravityView |
|
| 6 | - * @license GPL2+ |
|
| 7 | - * @author Katz Web Services, Inc. |
|
| 8 | - * @link http://gravityview.co |
|
| 9 | - * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | - * |
|
| 11 | - * @since 1.0.9 |
|
| 12 | - */ |
|
| 3 | + * GravityView Defining Post Types and Rewrite rules |
|
| 4 | + * |
|
| 5 | + * @package GravityView |
|
| 6 | + * @license GPL2+ |
|
| 7 | + * @author Katz Web Services, Inc. |
|
| 8 | + * @link http://gravityview.co |
|
| 9 | + * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | + * |
|
| 11 | + * @since 1.0.9 |
|
| 12 | + */ |
|
| 13 | 13 | |
| 14 | 14 | class GravityView_Post_Types { |
| 15 | 15 | |
@@ -10,159 +10,159 @@ discard block |
||
| 10 | 10 | * |
| 11 | 11 | * @var string |
| 12 | 12 | */ |
| 13 | - protected $name; |
|
| 13 | + protected $name; |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Field settings |
| 17 | 17 | * |
| 18 | 18 | * @var array |
| 19 | 19 | */ |
| 20 | - protected $field; |
|
| 20 | + protected $field; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Field current value |
| 24 | 24 | * |
| 25 | 25 | * @var mixed |
| 26 | 26 | */ |
| 27 | - protected $value; |
|
| 28 | - |
|
| 29 | - function __construct( $name = '', $field = array(), $curr_value = NULL ) { |
|
| 30 | - |
|
| 31 | - $this->name = $name; |
|
| 32 | - |
|
| 33 | - $defaults = self::get_field_defaults(); |
|
| 34 | - |
|
| 35 | - // Backward compatibility |
|
| 36 | - if( !empty( $field['choices'] ) ) { |
|
| 37 | - $field['options'] = $field['choices']; |
|
| 38 | - unset( $field['choices'] ); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - $this->field = wp_parse_args( $field, $defaults ); |
|
| 42 | - |
|
| 43 | - $this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value; |
|
| 44 | - |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * Returns the default details for a field option |
|
| 49 | - * |
|
| 50 | - * - default // default option value, in case nothing is defined (@deprecated) |
|
| 51 | - * - desc // option description |
|
| 52 | - * - value // the option default value |
|
| 53 | - * - label // the option label |
|
| 54 | - * - left_label // In case of checkboxes, left label will appear on the left of the checkbox |
|
| 55 | - * - id // the field id |
|
| 56 | - * - type // the option type ( text, checkbox, select, ... ) |
|
| 57 | - * - options // when type is select, define the select options ('choices' is @deprecated) |
|
| 58 | - * - merge_tags // if the option supports merge tags feature |
|
| 59 | - * - class // (new) define extra classes for the field |
|
| 60 | - * - tooltip // |
|
| 61 | - * |
|
| 62 | - * @return array |
|
| 63 | - */ |
|
| 64 | - public static function get_field_defaults() { |
|
| 65 | - return array( |
|
| 66 | - 'desc' => '', |
|
| 67 | - 'value' => NULL, |
|
| 68 | - 'label' => '', |
|
| 69 | - 'left_label' => NULL, |
|
| 70 | - 'id' => NULL, |
|
| 71 | - 'type' => 'text', |
|
| 72 | - 'options' => NULL, |
|
| 73 | - 'merge_tags' => true, |
|
| 74 | - 'class' => '', |
|
| 75 | - 'tooltip' => NULL |
|
| 76 | - ); |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - |
|
| 80 | - function get_tooltip() { |
|
| 81 | - if( !function_exists('gform_tooltip') ) { |
|
| 82 | - return NULL; |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - return !empty( $this->field['tooltip'] ) ? ' '.gform_tooltip( $this->field['tooltip'] , false, true ) : NULL; |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * Build input id based on the name |
|
| 90 | - * @return string |
|
| 91 | - */ |
|
| 92 | - function get_field_id() { |
|
| 93 | - if( isset( $this->field['id'] ) ) { |
|
| 94 | - return esc_attr( $this->field['id'] ); |
|
| 95 | - } |
|
| 96 | - return esc_attr( sanitize_html_class( $this->name ) ); |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - /** |
|
| 100 | - * Retrieve field label |
|
| 101 | - * @return string |
|
| 102 | - */ |
|
| 103 | - function get_field_label() { |
|
| 104 | - return esc_html( trim( $this->field['label'] ) ); |
|
| 105 | - } |
|
| 27 | + protected $value; |
|
| 28 | + |
|
| 29 | + function __construct( $name = '', $field = array(), $curr_value = NULL ) { |
|
| 30 | + |
|
| 31 | + $this->name = $name; |
|
| 32 | + |
|
| 33 | + $defaults = self::get_field_defaults(); |
|
| 34 | + |
|
| 35 | + // Backward compatibility |
|
| 36 | + if( !empty( $field['choices'] ) ) { |
|
| 37 | + $field['options'] = $field['choices']; |
|
| 38 | + unset( $field['choices'] ); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + $this->field = wp_parse_args( $field, $defaults ); |
|
| 42 | + |
|
| 43 | + $this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value; |
|
| 44 | + |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * Returns the default details for a field option |
|
| 49 | + * |
|
| 50 | + * - default // default option value, in case nothing is defined (@deprecated) |
|
| 51 | + * - desc // option description |
|
| 52 | + * - value // the option default value |
|
| 53 | + * - label // the option label |
|
| 54 | + * - left_label // In case of checkboxes, left label will appear on the left of the checkbox |
|
| 55 | + * - id // the field id |
|
| 56 | + * - type // the option type ( text, checkbox, select, ... ) |
|
| 57 | + * - options // when type is select, define the select options ('choices' is @deprecated) |
|
| 58 | + * - merge_tags // if the option supports merge tags feature |
|
| 59 | + * - class // (new) define extra classes for the field |
|
| 60 | + * - tooltip // |
|
| 61 | + * |
|
| 62 | + * @return array |
|
| 63 | + */ |
|
| 64 | + public static function get_field_defaults() { |
|
| 65 | + return array( |
|
| 66 | + 'desc' => '', |
|
| 67 | + 'value' => NULL, |
|
| 68 | + 'label' => '', |
|
| 69 | + 'left_label' => NULL, |
|
| 70 | + 'id' => NULL, |
|
| 71 | + 'type' => 'text', |
|
| 72 | + 'options' => NULL, |
|
| 73 | + 'merge_tags' => true, |
|
| 74 | + 'class' => '', |
|
| 75 | + 'tooltip' => NULL |
|
| 76 | + ); |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + |
|
| 80 | + function get_tooltip() { |
|
| 81 | + if( !function_exists('gform_tooltip') ) { |
|
| 82 | + return NULL; |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + return !empty( $this->field['tooltip'] ) ? ' '.gform_tooltip( $this->field['tooltip'] , false, true ) : NULL; |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * Build input id based on the name |
|
| 90 | + * @return string |
|
| 91 | + */ |
|
| 92 | + function get_field_id() { |
|
| 93 | + if( isset( $this->field['id'] ) ) { |
|
| 94 | + return esc_attr( $this->field['id'] ); |
|
| 95 | + } |
|
| 96 | + return esc_attr( sanitize_html_class( $this->name ) ); |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + /** |
|
| 100 | + * Retrieve field label |
|
| 101 | + * @return string |
|
| 102 | + */ |
|
| 103 | + function get_field_label() { |
|
| 104 | + return esc_html( trim( $this->field['label'] ) ); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | 108 | * Retrieve field left label |
| 109 | - * |
|
| 110 | - * @since 1.7 |
|
| 111 | - * |
|
| 109 | + * |
|
| 110 | + * @since 1.7 |
|
| 111 | + * |
|
| 112 | 112 | * @return string |
| 113 | 113 | */ |
| 114 | 114 | function get_field_left_label() { |
| 115 | 115 | return ! empty( $this->field['left_label'] ) ? esc_html( trim( $this->field['left_label'] ) ) : NULL; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - /** |
|
| 119 | - * Retrieve field label class |
|
| 120 | - * @return string |
|
| 121 | - */ |
|
| 122 | - function get_label_class() { |
|
| 123 | - return 'gv-label-'. sanitize_html_class( $this->field['type'] ); |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - |
|
| 127 | - /** |
|
| 128 | - * Retrieve field description |
|
| 129 | - * @return string |
|
| 130 | - */ |
|
| 131 | - function get_field_desc() { |
|
| 132 | - return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : ''; |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - |
|
| 136 | - /** |
|
| 137 | - * Verify if field should have merge tags |
|
| 138 | - * @return boolean |
|
| 139 | - */ |
|
| 140 | - function show_merge_tags() { |
|
| 141 | - // Show the merge tags if the field is a list view |
|
| 142 | - $is_list = preg_match( '/_list-/ism', $this->name ); |
|
| 143 | - // Or is a single entry view |
|
| 144 | - $is_single = preg_match( '/single_/ism', $this->name ); |
|
| 145 | - |
|
| 146 | - return ( $is_single || $is_list ); |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - |
|
| 150 | - |
|
| 151 | - /** |
|
| 152 | - * important! Override this class |
|
| 153 | - * outputs the field option html |
|
| 154 | - */ |
|
| 155 | - function render_option() { |
|
| 156 | - // to replace on each field |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * important! Override this class if needed |
|
| 161 | - * outputs the field setting html |
|
| 162 | - */ |
|
| 163 | - function render_setting( $override_input = NULL ) { |
|
| 164 | - |
|
| 165 | - if( !empty( $this->field['full_width'] ) ) { ?> |
|
| 118 | + /** |
|
| 119 | + * Retrieve field label class |
|
| 120 | + * @return string |
|
| 121 | + */ |
|
| 122 | + function get_label_class() { |
|
| 123 | + return 'gv-label-'. sanitize_html_class( $this->field['type'] ); |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + |
|
| 127 | + /** |
|
| 128 | + * Retrieve field description |
|
| 129 | + * @return string |
|
| 130 | + */ |
|
| 131 | + function get_field_desc() { |
|
| 132 | + return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : ''; |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * Verify if field should have merge tags |
|
| 138 | + * @return boolean |
|
| 139 | + */ |
|
| 140 | + function show_merge_tags() { |
|
| 141 | + // Show the merge tags if the field is a list view |
|
| 142 | + $is_list = preg_match( '/_list-/ism', $this->name ); |
|
| 143 | + // Or is a single entry view |
|
| 144 | + $is_single = preg_match( '/single_/ism', $this->name ); |
|
| 145 | + |
|
| 146 | + return ( $is_single || $is_list ); |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + |
|
| 150 | + |
|
| 151 | + /** |
|
| 152 | + * important! Override this class |
|
| 153 | + * outputs the field option html |
|
| 154 | + */ |
|
| 155 | + function render_option() { |
|
| 156 | + // to replace on each field |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * important! Override this class if needed |
|
| 161 | + * outputs the field setting html |
|
| 162 | + */ |
|
| 163 | + function render_setting( $override_input = NULL ) { |
|
| 164 | + |
|
| 165 | + if( !empty( $this->field['full_width'] ) ) { ?> |
|
| 166 | 166 | <th scope="row" colspan="2"> |
| 167 | 167 | <div> |
| 168 | 168 | <label for="<?php echo $this->get_field_id(); ?>"> |
@@ -182,14 +182,14 @@ discard block |
||
| 182 | 182 | </td> |
| 183 | 183 | <?php } |
| 184 | 184 | |
| 185 | - } |
|
| 185 | + } |
|
| 186 | 186 | |
| 187 | - /** |
|
| 188 | - * important! Override this class |
|
| 189 | - * outputs the input html part |
|
| 190 | - */ |
|
| 191 | - function render_input( $override_input ) { |
|
| 192 | - echo ''; |
|
| 193 | - } |
|
| 187 | + /** |
|
| 188 | + * important! Override this class |
|
| 189 | + * outputs the input html part |
|
| 190 | + */ |
|
| 191 | + function render_input( $override_input ) { |
|
| 192 | + echo ''; |
|
| 193 | + } |
|
| 194 | 194 | |
| 195 | 195 | } |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | |
| 123 | 123 | $atts = array( |
| 124 | 124 | 'format' => self::get_format_from_modifiers( $exploded, false ), |
| 125 | - 'human' => in_array( 'human', $exploded ), // {date_created:human} |
|
| 125 | + 'human' => in_array( 'human', $exploded ), // {date_created:human} |
|
| 126 | 126 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
| 127 | 127 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
| 128 | 128 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Display the search all input box |
|
| 4 | - * |
|
| 5 | - * @see class-search-widget.php |
|
| 6 | - */ |
|
| 3 | + * Display the search all input box |
|
| 4 | + * |
|
| 5 | + * @see class-search-widget.php |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
| 9 | 9 | $view_id = $gravityview_view->getViewId(); |
@@ -1,15 +1,15 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Handle issues with plugin and version compatibility |
|
| 4 | - * |
|
| 5 | - * @package GravityView |
|
| 6 | - * @license GPL2+ |
|
| 7 | - * @author Katz Web Services, Inc. |
|
| 8 | - * @link http://gravityview.co |
|
| 9 | - * @copyright Copyright 2015, Katz Web Services, Inc. |
|
| 10 | - * |
|
| 11 | - * @since 1.12 |
|
| 12 | - */ |
|
| 3 | + * Handle issues with plugin and version compatibility |
|
| 4 | + * |
|
| 5 | + * @package GravityView |
|
| 6 | + * @license GPL2+ |
|
| 7 | + * @author Katz Web Services, Inc. |
|
| 8 | + * @link http://gravityview.co |
|
| 9 | + * @copyright Copyright 2015, Katz Web Services, Inc. |
|
| 10 | + * |
|
| 11 | + * @since 1.12 |
|
| 12 | + */ |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * Handle GravityView compatibility notices and fallback shortcodes |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | self::$notices['wp_version'] = array( |
| 205 | 205 | 'class' => 'error', |
| 206 | 206 | 'message' => sprintf( __( "%sGravityView requires WordPress %s or newer.%s \n\nYou're using Version %s. Please upgrade your WordPress installation.", 'gravityview' ), '<h3>', GV_MIN_WP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">'.$wp_version.'</span>' ), |
| 207 | - 'cap' => 'update_core', |
|
| 207 | + 'cap' => 'update_core', |
|
| 208 | 208 | 'dismiss' => 'wp_version', |
| 209 | 209 | ); |
| 210 | 210 | |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Display the search by entry date input boxes |
|
| 4 | - * |
|
| 5 | - * @see class-search-widget.php |
|
| 6 | - */ |
|
| 3 | + * Display the search by entry date input boxes |
|
| 4 | + * |
|
| 5 | + * @see class-search-widget.php |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
| 9 | 9 | $search_field = $gravityview_view->search_field; |
@@ -1037,15 +1037,15 @@ |
||
| 1037 | 1037 | GFForms::register_scripts(); |
| 1038 | 1038 | |
| 1039 | 1039 | $scripts = array( |
| 1040 | - 'sack', |
|
| 1041 | - 'gform_gravityforms', |
|
| 1042 | - 'gform_forms', |
|
| 1043 | - 'gform_form_admin', |
|
| 1044 | - 'jquery-ui-autocomplete' |
|
| 1040 | + 'sack', |
|
| 1041 | + 'gform_gravityforms', |
|
| 1042 | + 'gform_forms', |
|
| 1043 | + 'gform_form_admin', |
|
| 1044 | + 'jquery-ui-autocomplete' |
|
| 1045 | 1045 | ); |
| 1046 | 1046 | |
| 1047 | 1047 | if ( wp_is_mobile() ) { |
| 1048 | - $scripts[] = 'jquery-touch-punch'; |
|
| 1048 | + $scripts[] = 'jquery-touch-punch'; |
|
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | 1051 | foreach ($scripts as $script) { |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file select-template.php |
|
| 4 | - * @package GravityView |
|
| 5 | - * @subpackage Gravityview/admin/metaboxes/partials |
|
| 6 | - * @global WP_Post $post |
|
| 7 | - */ |
|
| 3 | + * @file select-template.php |
|
| 4 | + * @package GravityView |
|
| 5 | + * @subpackage Gravityview/admin/metaboxes/partials |
|
| 6 | + * @global WP_Post $post |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | global $post; |
| 10 | 10 | |