@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * GravityView Frontend functions |
|
| 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.0 |
|
| 12 | - */ |
|
| 3 | + * GravityView Frontend functions |
|
| 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.0 |
|
| 12 | + */ |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | class GravityView_frontend { |
@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Adds a button to add the View shortcode into the post content |
|
| 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.0 |
|
| 12 | - */ |
|
| 3 | + * Adds a button to add the View shortcode into the post content |
|
| 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.0 |
|
| 12 | + */ |
|
| 13 | 13 | |
| 14 | 14 | /** If this file is called directly, abort. */ |
| 15 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * The GravityView New Search widget |
|
| 4 | - * |
|
| 5 | - * @package GravityView-DataTables-Ext |
|
| 6 | - * @license GPL2+ |
|
| 7 | - * @author Katz Web Services, Inc. |
|
| 8 | - * @link http://gravityview.co |
|
| 9 | - * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | - */ |
|
| 3 | + * The GravityView New Search widget |
|
| 4 | + * |
|
| 5 | + * @package GravityView-DataTables-Ext |
|
| 6 | + * @license GPL2+ |
|
| 7 | + * @author Katz Web Services, Inc. |
|
| 8 | + * @link http://gravityview.co |
|
| 9 | + * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | if ( ! defined( 'WPINC' ) ) { |
| 13 | 13 | die; |
@@ -384,16 +384,16 @@ discard block |
||
| 384 | 384 | $curr_start = esc_attr( rgget( 'gv_start' ) ); |
| 385 | 385 | $curr_end = esc_attr( rgget( 'gv_end' ) ); |
| 386 | 386 | |
| 387 | - /** |
|
| 388 | - * @filter `gravityview_date_created_adjust_timezone` Whether to adjust the timezone for entries. \n |
|
| 389 | - * date_created is stored in UTC format. Convert search date into UTC (also used on templates/fields/date_created.php) |
|
| 390 | - * @since 1.12 |
|
| 391 | - * @param[out,in] boolean $adjust_tz Use timezone-adjusted datetime? If true, adjusts date based on blog's timezone setting. If false, uses UTC setting. Default: true |
|
| 392 | - * @param[in] string $context Where the filter is being called from. `search` in this case. |
|
| 393 | - */ |
|
| 394 | - $adjust_tz = apply_filters( 'gravityview_date_created_adjust_timezone', true, 'search' ); |
|
| 395 | - $search_criteria['start_date'] = ( $adjust_tz && !empty( $curr_start ) ) ? get_gmt_from_date( $curr_start ) : $curr_start; |
|
| 396 | - $search_criteria['end_date'] = ( $adjust_tz && !empty( $curr_end ) ) ? get_gmt_from_date( $curr_end ) : $curr_end; |
|
| 387 | + /** |
|
| 388 | + * @filter `gravityview_date_created_adjust_timezone` Whether to adjust the timezone for entries. \n |
|
| 389 | + * date_created is stored in UTC format. Convert search date into UTC (also used on templates/fields/date_created.php) |
|
| 390 | + * @since 1.12 |
|
| 391 | + * @param[out,in] boolean $adjust_tz Use timezone-adjusted datetime? If true, adjusts date based on blog's timezone setting. If false, uses UTC setting. Default: true |
|
| 392 | + * @param[in] string $context Where the filter is being called from. `search` in this case. |
|
| 393 | + */ |
|
| 394 | + $adjust_tz = apply_filters( 'gravityview_date_created_adjust_timezone', true, 'search' ); |
|
| 395 | + $search_criteria['start_date'] = ( $adjust_tz && !empty( $curr_start ) ) ? get_gmt_from_date( $curr_start ) : $curr_start; |
|
| 396 | + $search_criteria['end_date'] = ( $adjust_tz && !empty( $curr_end ) ) ? get_gmt_from_date( $curr_end ) : $curr_end; |
|
| 397 | 397 | |
| 398 | 398 | |
| 399 | 399 | // search for a specific entry ID |
@@ -1,15 +1,15 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * GravityView template tags API |
|
| 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.0 |
|
| 12 | - */ |
|
| 3 | + * GravityView template tags API |
|
| 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.0 |
|
| 12 | + */ |
|
| 13 | 13 | |
| 14 | 14 | class GravityView_API { |
| 15 | 15 | |
@@ -146,20 +146,20 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if( !empty( $field['custom_class'] ) ) { |
| 148 | 148 | |
| 149 | - $custom_class = $field['custom_class']; |
|
| 149 | + $custom_class = $field['custom_class']; |
|
| 150 | 150 | |
| 151 | - if( !empty( $entry ) ) { |
|
| 151 | + if( !empty( $entry ) ) { |
|
| 152 | 152 | |
| 153 | - // We want the merge tag to be formatted as a class. The merge tag may be |
|
| 154 | - // replaced by a multiple-word value that should be output as a single class. |
|
| 155 | - // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager` |
|
| 156 | - add_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 153 | + // We want the merge tag to be formatted as a class. The merge tag may be |
|
| 154 | + // replaced by a multiple-word value that should be output as a single class. |
|
| 155 | + // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager` |
|
| 156 | + add_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 157 | 157 | |
| 158 | - $custom_class = self::replace_variables( $custom_class, $form, $entry); |
|
| 158 | + $custom_class = self::replace_variables( $custom_class, $form, $entry); |
|
| 159 | 159 | |
| 160 | - // And then we want life to return to normal |
|
| 161 | - remove_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 162 | - } |
|
| 160 | + // And then we want life to return to normal |
|
| 161 | + remove_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | 164 | // And now we want the spaces to be handled nicely. |
| 165 | 165 | $classes[] = gravityview_sanitize_html_class( $custom_class ); |
@@ -591,29 +591,29 @@ discard block |
||
| 591 | 591 | return sanitize_title( $slug ); |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - /** |
|
| 595 | - * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta |
|
| 596 | - * |
|
| 597 | - * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 598 | - * |
|
| 599 | - * @param $entry array Gravity Forms entry object |
|
| 600 | - * @param $form array Gravity Forms form object |
|
| 601 | - */ |
|
| 602 | - public static function entry_create_custom_slug( $entry, $form ) { |
|
| 603 | - /** |
|
| 604 | - * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta |
|
| 605 | - * @param boolean $custom Should we process the custom entry slug? |
|
| 606 | - */ |
|
| 607 | - $custom = apply_filters( 'gravityview_custom_entry_slug', false ); |
|
| 608 | - if( $custom ) { |
|
| 609 | - // create the gravityview_unique_id and save it |
|
| 594 | + /** |
|
| 595 | + * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta |
|
| 596 | + * |
|
| 597 | + * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 598 | + * |
|
| 599 | + * @param $entry array Gravity Forms entry object |
|
| 600 | + * @param $form array Gravity Forms form object |
|
| 601 | + */ |
|
| 602 | + public static function entry_create_custom_slug( $entry, $form ) { |
|
| 603 | + /** |
|
| 604 | + * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta |
|
| 605 | + * @param boolean $custom Should we process the custom entry slug? |
|
| 606 | + */ |
|
| 607 | + $custom = apply_filters( 'gravityview_custom_entry_slug', false ); |
|
| 608 | + if( $custom ) { |
|
| 609 | + // create the gravityview_unique_id and save it |
|
| 610 | 610 | |
| 611 | - // Get the entry hash |
|
| 612 | - $hash = self::get_custom_entry_slug( $entry['id'], $entry ); |
|
| 613 | - gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash ); |
|
| 611 | + // Get the entry hash |
|
| 612 | + $hash = self::get_custom_entry_slug( $entry['id'], $entry ); |
|
| 613 | + gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash ); |
|
| 614 | 614 | |
| 615 | - } |
|
| 616 | - } |
|
| 615 | + } |
|
| 616 | + } |
|
| 617 | 617 | |
| 618 | 618 | |
| 619 | 619 | |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | // If there was an error, continue to the next term. |
| 853 | 853 | if ( is_wp_error( $term_link ) ) { |
| 854 | - continue; |
|
| 854 | + continue; |
|
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | $output[] = gravityview_get_link( $term_link, esc_html( $term->name ) ); |