Ticket #1517: 1517.1.patch
File 1517.1.patch, 1.5 KB (added by , 9 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/searchform.php
51 51 'wp-parser-class' => __( 'Classes', 'wporg' ), 52 52 'wp-parser-method' => __( 'Methods', 'wporg' ), 53 53 ); 54 55 $qv_post_type = array_filter( (array) get_query_var( 'post_type' ) ); 56 57 if ( in_array( 'any', $qv_post_type ) ) { 58 $qv_post_type = array_keys( $search_post_types ); 59 } 60 54 61 foreach ( $search_post_types as $post_type => $label ) { 55 $qv_post_type = (array) get_query_var( 'post_type' ); 62 $checked = checked( in_array( $post_type, $qv_post_type ), true, false ); 63 64 // Set functions as default if no post types are found in the query. 65 if( empty( $qv_post_type ) && ('wp-parser-function' === $post_type ) ){ 66 $checked = ' checked="checked"'; 67 } 56 68 ?> 57 69 <label><input type="checkbox" name="post_type[]" value="<?php echo esc_attr( $post_type ); ?>" 58 <?php checked( ! is_search() || in_array( 'any', $qv_post_type ) || in_array( $post_type, $qv_post_type ) ); ?> /> <?php echo $label; ?></label>70 <?php echo $checked; ?> /> <?php echo $label; ?></label> 59 71 <?php } ?> 60 72 </div> 61 73 </form>