Changeset 1539
- Timestamp:
- 05/04/2015 07:48:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
r1538 r1539 277 277 ), $attr ); 278 278 279 foreach ( array( 'orderby', 'order', 'track', 'speaker_link' ) as $key_for_case_sensitive_value ) { 280 $attr[ $key_for_case_sensitive_value ] = strtolower( $attr[ $key_for_case_sensitive_value ] ); 281 } 282 279 283 $attr['show_avatars'] = $this->str_to_bool( $attr['show_avatars'] ); 280 284 $attr['orderby'] = in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ? $attr['orderby'] : 'date'; … … 406 410 407 411 $attr['show_avatars'] = $this->str_to_bool( $attr['show_avatars'] ); 412 $attr['orderby'] = strtolower( $attr['orderby'] ); 408 413 $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ) ? $attr['orderby'] : 'date'; 409 414 … … 457 462 'session_link' => 'permalink', // permalink|anchor|none 458 463 ), $attr ); 464 465 foreach ( array( 'tracks', 'speaker_link', 'session_link' ) as $key_for_case_sensitive_value ) { 466 $attr[ $key_for_case_sensitive_value ] = strtolower( $attr[ $key_for_case_sensitive_value ] ); 467 } 459 468 460 469 if ( ! in_array( $attr['speaker_link'], array( 'anchor', 'wporg', 'permalink', 'none' ) ) ) … … 819 828 820 829 /** 821 * Convert s 'true'/'yes'/true to true, the rest are false.830 * Convert a string representation of a boolean to an actual boolean 822 831 */ 823 832 function str_to_bool( $value ) { 824 if ( $value == 'yes' || $value == 'true' || $value === true ) 833 $value = strtolower( trim( $value ) ); 834 835 if ( true === $value || in_array( $value, array( 'yes', 'true', '1' ) ) ) { 825 836 return true; 837 } 838 826 839 return false; 827 840 } … … 851 864 852 865 // Clean up other attributes. 866 foreach ( array( 'track', 'speaker_link', 'orderby', 'order' ) as $key_for_case_sensitive_value ) { 867 $attr[ $key_for_case_sensitive_value ] = strtolower( $attr[ $key_for_case_sensitive_value ] ); 868 } 869 853 870 $attr['avatar_size'] = absint( $attr['avatar_size'] ); 854 871 … … 1020 1037 ), $attr ); 1021 1038 1039 $attr['link'] = strtolower( $attr['link'] ); 1022 1040 $terms = $this->get_sponsor_levels(); 1023 1041
Note: See TracChangeset
for help on using the changeset viewer.