Ticket #6844: 6844-02.patch
File 6844-02.patch, 8.6 KB (added by , 9 years ago) |
---|
-
src/bp-core/bp-core-functions.php
837 837 * @param string $component Component name. 838 838 * @return string|bool Query argument on success. False on failure. 839 839 */ 840 function bp_core_get_component_search_query_arg( $component ) { 840 function bp_core_get_component_search_query_arg( $component = null ) { 841 if ( ! $component ) { 842 $component = bp_current_component(); 843 } 844 841 845 $query_arg = false; 842 846 if ( isset( buddypress()->{$component}->search_query_arg ) ) { 843 847 $query_arg = sanitize_title( buddypress()->{$component}->search_query_arg ); -
src/bp-core/bp-core-template.php
571 571 } 572 572 573 573 /** 574 * Output the 'name' attribute for search form input element. 575 * 576 * @since 2.5.0 577 * 578 * @param string $component See {@link bp_get_search_input_name()}. 579 */ 580 function bp_search_input_name( $component = '' ) { 581 echo esc_attr( bp_get_search_input_name( $component ) ); 582 } 583 /** 584 * Get the 'name' attribute for the search form input element. 585 * 586 * @since 2.5.0 587 * 588 * @param string $component Component name. Defaults to current component. 589 * @return string Text for the 'name' attribute. 590 */ 591 function bp_get_search_input_name( $component = '' ) { 592 if ( ! $component ) { 593 $component = bp_current_component(); 594 } 595 596 $bp = buddypress(); 597 598 $name = ''; 599 if ( isset( $bp->{$component}->id ) ) { 600 $name = $bp->{$component}->id . '_search'; 601 } 602 603 return $name; 604 } 605 606 /** 607 * Output the placeholder text for the search box for a given component. 608 * 609 * @since 2.5.0 610 * 611 * @param string $component See {@link bp_get_search_placeholder()}. 612 */ 613 function bp_search_placeholder( $component = '' ) { 614 echo esc_attr( bp_get_search_placeholder( $component ) ); 615 } 616 /** 617 * Get the placeholder text for the search box for a given component. 618 * 619 * @since 2.5.0 620 * 621 * @param string $component Component name. Defaults to current component. 622 * @return string Placeholder text for the search field. 623 */ 624 function bp_get_search_placeholder( $component = '' ) { 625 $query_arg = bp_core_get_component_search_query_arg( $component ); 626 627 if ( $query_arg && ! empty( $_REQUEST[ $query_arg ] ) ) { 628 $placeholder = wp_unslash( $_REQUEST[ $query_arg ] ); 629 } else { 630 $placeholder = bp_get_search_default_text( $component ); 631 } 632 633 return $placeholder; 634 } 635 636 /** 574 637 * Output the default text for the search box for a given component. 575 638 * 576 639 * @since 1.5.0 -
src/bp-templates/bp-legacy/buddypress/blogs/index.php
33 33 */ 34 34 do_action( 'bp_before_directory_blogs_content' ); ?> 35 35 36 <div id="blog-dir-search" class="dir-search" role="search"> 37 <?php bp_directory_blogs_search_form(); ?> 38 </div><!-- #blog-dir-search --> 36 <?php if ( has_filter( 'bp_directory_blogs_search_form' ) ) : ?> 37 <div id="blog-dir-search" class="dir-search" role="search"> 38 <?php bp_directory_blogs_search_form(); ?> 39 </div><!-- #blog-dir-search --> 40 <?php else : ?> 41 <?php bp_get_template_part( 'common/dir-search-form' ); ?> 42 <?php endif; ?> 39 43 44 40 45 <?php 41 46 42 47 /** -
src/bp-templates/bp-legacy/buddypress/common/dir-search-form.php
1 <div id="<?php esc_attr_e( bp_current_component() ); ?>-dir-search" class="dir-search" role="search"> 2 <form action="" method="get" id="search-<?php esc_attr_e( bp_current_component() ); ?>-form"> 3 <label for="<?php bp_search_input_name(); ?>" class="bp-screen-reader-text"><?php bp_search_placeholder(); ?></label> 4 <input type="text" name="<?php esc_attr_e( bp_core_get_component_search_query_arg() ); ?>" id="<?php bp_search_input_name(); ?>" placeholder="<?php bp_search_placeholder(); ?>" /> 5 <input type="submit" id="<?php esc_attr_e( bp_get_search_input_name() ); ?>_submit" name="<?php bp_search_input_name(); ?>_submit" value="<?php esc_html_e( 'Search', 'buddypress' ); ?>" /> 6 </form> 7 </div><!-- #<?php esc_attr_e( bp_current_component() ); ?>-dir-search --> -
src/bp-templates/bp-legacy/buddypress/common/dir-search-form.php
Property changes on: src/bp-templates/bp-legacy/buddypress/common/dir-search-form.php ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 <div id="<?php esc_attr_e( bp_current_component() ); ?>-dir-search" class="dir-search" role="search"> 2 <form action="" method="get" id="search-<?php esc_attr_e( bp_current_component() ); ?>-form"> 3 <label for="<?php bp_search_input_name(); ?>" class="bp-screen-reader-text"><?php bp_search_placeholder(); ?></label> 4 <input type="text" name="<?php esc_attr_e( bp_core_get_component_search_query_arg() ); ?>" id="<?php bp_search_input_name(); ?>" placeholder="<?php bp_search_placeholder(); ?>" /> 5 <input type="submit" id="<?php esc_attr_e( bp_get_search_input_name() ); ?>_submit" name="<?php bp_search_input_name(); ?>_submit" value="<?php esc_html_e( 'Search', 'buddypress' ); ?>" /> 6 </form> 7 </div><!-- #<?php esc_attr_e( bp_current_component() ); ?>-dir-search --> -
src/bp-templates/bp-legacy/buddypress/forums/index.php
Property changes on: src/bp-templates/bp-legacy/buddypress/common/dir-search-form.php ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
29 29 */ 30 30 do_action( 'bp_before_directory_forums_content' ); ?> 31 31 32 <?php if ( has_filter( 'bp_directory_forums_search_form' ) ) : ?> 32 33 <div id="forums-dir-search" class="dir-search" role="search"> 33 34 34 <?php bp_directory_forums_search_form(); ?> 35 </div> 36 <?php else : ?> 37 <?php bp_get_template_part( 'common/dir-search-form' ); ?> 38 <?php endif; ?> 35 39 36 </div>37 40 </form> 38 41 39 42 <?php -
src/bp-templates/bp-legacy/buddypress/groups/index.php
33 33 */ 34 34 do_action( 'bp_before_directory_groups_content' ); ?> 35 35 36 <div id="group-dir-search" class="dir-search" role="search"> 37 <?php bp_directory_groups_search_form(); ?> 38 </div><!-- #group-dir-search --> 36 <?php if ( has_filter( 'bp_directory_groups_search_form' ) ) : ?> 37 <div id="group-dir-search" class="dir-search" role="search"> 38 <?php bp_directory_groups_search_form(); ?> 39 </div><!-- #group-dir-search --> 40 <?php else : ?> 41 <?php bp_get_template_part( 'common/dir-search-form' ); ?> 42 <?php endif; ?> 39 43 40 44 <form action="" method="post" id="groups-directory-form" class="dir-form"> 41 45 -
src/bp-templates/bp-legacy/buddypress/members/index.php
33 33 */ 34 34 do_action( 'bp_before_directory_members_content' ); ?> 35 35 36 <div id="members-dir-search" class="dir-search" role="search"> 37 <?php bp_directory_members_search_form(); ?> 38 </div><!-- #members-dir-search --> 36 <?php if ( has_filter( 'bp_directory_members_search_form' ) ) : ?> 37 <div id="members-dir-search" class="dir-search" role="search"> 38 <?php bp_directory_members_search_form(); ?> 39 </div><!-- #members-dir-search --> 40 <?php else : ?> 41 <?php bp_get_template_part( 'common/dir-search-form' ); ?> 42 <?php endif; ?> 39 43 40 44 <?php 41 45