| @@ -18,8 +18,9 @@ | ||
| 18 | 18 | ( !in_array( $department, array('', 'commercial') ) && ph_get_custom_department_based_on($department) != 'commercial' ) || |
| 19 | 19 | ( $department == '' && get_option( 'propertyhive_primary_department' ) != 'commercial' && ph_get_custom_department_based_on(get_option( 'propertyhive_primary_department' )) != 'commercial' ) |
| 20 | 20 | ) |
| 21 | 21 | { |
| 22 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone. | |
| 22 | 23 | $results_orderby = apply_filters( 'propertyhive_results_orderby', array( |
| 23 | 24 | 'price-desc' => __( 'Default sorting', 'propertyhive' ), |
| 24 | 25 | 'date' => __( 'Sort by date added', 'propertyhive' ), |
| 25 | 26 | 'price-asc' => __( 'Sort by price: low to high', 'propertyhive' ), |
| @@ -27,8 +28,9 @@ | ||
| 27 | 28 | ) ); |
| 28 | 29 | } |
| 29 | 30 | else |
| 30 | 31 | { |
| 32 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone. | |
| 31 | 33 | $results_orderby = apply_filters( 'propertyhive_results_orderby', array( |
| 32 | 34 | 'floor_area-desc' => __( 'Default sorting', 'propertyhive' ), |
| 33 | 35 | 'date' => __( 'Sort by date added', 'propertyhive' ), |
| 34 | 36 | 'floor_area-asc' => __( 'Sort by floor area: low to high', 'propertyhive' ), |
| @@ -42,8 +44,9 @@ | ||
| 42 | 44 | { |
| 43 | 45 | ?> |
| 44 | 46 | <select name="orderby" class="orderby"> |
| 45 | 47 | <?php |
| 48 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone. | |
| 46 | 49 | foreach ( $results_orderby as $id => $name ) |
| 47 | 50 | { |
| 48 | 51 | echo '<option value="' . esc_attr( $id ) . '" ' . selected( $orderby, $id, false ) . '>' . esc_attr( $name ) . '</option>'; |
| 49 | 52 | } |
| @@ -52,13 +55,15 @@ | ||
| 52 | 55 | <?php |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | 58 | // Keep query string vars intact |
| 59 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound, WordPress.Security.NonceVerification.Recommended -- Function-scoped template locals preserve read-only search filters; every hidden-field name/value is escaped below. | |
| 56 | 60 | foreach ( $_GET as $key => $val ) { |
| 57 | 61 | if ( 'orderby' === $key || 'submit' === $key ) |
| 58 | 62 | continue; |
| 59 | 63 | |
| 60 | 64 | if ( is_array( $val ) ) { |
| 65 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone. | |
| 61 | 66 | foreach( $val as $innerVal ) { |
| 62 | 67 | echo '<input type="hidden" name="' . esc_attr( $key ) . '[]" value="' . esc_attr( $innerVal ) . '" />'; |
| 63 | 68 | } |
| 64 | 69 | |