Ticket #6844: 6844-04.patch
File 6844-04.patch, 7.3 KB (added by , 8 years ago) |
---|
-
src/bp-core/bp-core-functions.php
854 854 * @param string $component Component name. 855 855 * @return string|bool Query argument on success. False on failure. 856 856 */ 857 function bp_core_get_component_search_query_arg( $component ) { 857 function bp_core_get_component_search_query_arg( $component = null ) { 858 if ( ! $component ) { 859 $component = bp_current_component(); 860 } 861 858 862 $query_arg = false; 859 863 if ( isset( buddypress()->{$component}->search_query_arg ) ) { 860 864 $query_arg = sanitize_title( buddypress()->{$component}->search_query_arg ); -
src/bp-core/bp-core-template.php
585 585 } 586 586 587 587 /** 588 * Output the 'name' attribute for search form input element. 589 * 590 * @since 2.7.0 591 * 592 * @param string $component See {@link bp_get_search_input_name()}. 593 */ 594 function bp_search_input_name( $component = '' ) { 595 echo esc_attr( bp_get_search_input_name( $component ) ); 596 } 597 /** 598 * Get the 'name' attribute for the search form input element. 599 * 600 * @since 2.7.0 601 * 602 * @param string $component Component name. Defaults to current component. 603 * @return string Text for the 'name' attribute. 604 */ 605 function bp_get_search_input_name( $component = '' ) { 606 if ( ! $component ) { 607 $component = bp_current_component(); 608 } 609 610 $bp = buddypress(); 611 612 $name = ''; 613 if ( isset( $bp->{$component}->id ) ) { 614 $name = $bp->{$component}->id . '_search'; 615 } 616 617 return $name; 618 } 619 620 /** 621 * Output the placeholder text for the search box for a given component. 622 * 623 * @since 2.7.0 624 * 625 * @param string $component See {@link bp_get_search_placeholder()}. 626 */ 627 function bp_search_placeholder( $component = '' ) { 628 echo esc_attr( bp_get_search_placeholder( $component ) ); 629 } 630 /** 631 * Get the placeholder text for the search box for a given component. 632 * 633 * @since 2.7.0 634 * 635 * @param string $component Component name. Defaults to current component. 636 * @return string Placeholder text for the search field. 637 */ 638 function bp_get_search_placeholder( $component = '' ) { 639 $query_arg = bp_core_get_component_search_query_arg( $component ); 640 641 if ( $query_arg && ! empty( $_REQUEST[ $query_arg ] ) ) { 642 $placeholder = wp_unslash( $_REQUEST[ $query_arg ] ); 643 } else { 644 $placeholder = bp_get_search_default_text( $component ); 645 } 646 647 return $placeholder; 648 } 649 650 /** 588 651 * Output the default text for the search box for a given component. 589 652 * 590 653 * @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/search/dir-search-form' ); ?> 42 <?php endif; ?> 39 43 44 40 45 <?php 41 46 42 47 /** -
src/bp-templates/bp-legacy/buddypress/common/search/dir-search-form.php
1 <div id="<?php echo esc_attr( bp_current_component() ); ?>-dir-search" class="dir-search" role="search"> 2 <form action="" method="get" id="search-<?php echo esc_attr( 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 echo esc_attr( bp_core_get_component_search_query_arg() ); ?>" id="<?php bp_search_input_name(); ?>" placeholder="<?php bp_search_placeholder(); ?>" /> 5 <input type="submit" id="<?php echo esc_attr( bp_get_search_input_name() ); ?>_submit" name="<?php bp_search_input_name(); ?>_submit" value="<?php echo esc_html( '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/search/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/search/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/search/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/search/dir-search-form' ); ?> 42 <?php endif; ?> 39 43 40 44 <?php 41 45