Skip to:
Content

BuddyPress.org

Ticket #6113: 6113-01.patch

File 6113-01.patch, 2.2 KB (added by hnla, 10 years ago)

Update message search for html filter

  • src/bp-messages/bp-messages-template.php

     
    10971097function bp_message_search_form() {
    10981098
    10991099        $default_search_value = bp_get_search_default_text( 'messages' );
    1100         $search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
     1100        $search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value;
    11011101
    1102         <form action="" method="get" id="search-message-form">
    1103                 <label for="messages_search" class="bp-screen-reader-text"><?php _e( 'Search Messages', 'buddypress' ); ?></label>
    1104                 <input type="text" name="s" id="messages_search" <?php if ( $search_value === $default_search_value ) : ?>placeholder="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> <?php if ( $search_value !== $default_search_value ) : ?>value="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> />
    1105                 <input type="submit" id="messages_search_submit" name="messages_search_submit" value="<?php esc_attr_e( 'Search', 'buddypress' ) ?>" />
    1106         </form>
     1102        $message_placeholder = ( $search_value === $default_search_value ) ? ' placeholder="' .  esc_attr( $search_value ) . '"' : '' ;
     1103        $message_value = ( $search_value !== $default_search_value ) ? ' value="' .  esc_attr( $search_value ) . '"' : '' ;
    11071104
    1108 <?php
     1105        $search_form_html =     '<form action="" method="get" id="search-message-form">';
     1106        $search_form_html .=    '<label for="messages_search" class="bp-screen-reader-text">' . __( 'Search Messages', 'buddypress' ) . '</label>';
     1107        $search_form_html .=    '<input type="text" name="s" id="messages_search"' . $message_placeholder . $message_value . ' />';
     1108        $search_form_html .=    '<input type="submit" id="messages_search_submit" name="messages_search_submit" value="' . __( 'Search', 'buddypress' ) . '" /></form>';
     1109
     1110        /**
     1111         * Filters the private message component search form.
     1112         *
     1113         * @since BuddyPress (2.2.0)
     1114         *
     1115         * @param string $search_form_html HTML markup for the message search form.
     1116         */
     1117        echo apply_filters( 'bp_message_search_form', $search_form_html );
    11091118}
    11101119
    11111120/**