Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/07/2018 09:44:24 PM (8 years ago)
Author:
imath
Message:

BP Nouveau: bring back search form filters

Although it was already possible to override search form templates, as the following search form filters are not Legacy filters but Core components ones, we are bringing them back into the Nouveau template pack:

  • bp_directory_members_search_form
  • bp_directory_blogs_search_form
  • bp_directory_groups_search_form
  • bp_message_search_form

Props wbcomdesigns, DJPaul, vapvarun

See #7881 (branch 3.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12157 r12183  
    18461846 */
    18471847function bp_nouveau_search_form() {
    1848         bp_get_template_part( 'common/search/search-form' );
     1848        $search_form_html = bp_buffer_template_part( 'common/search/search-form', null, false );
    18491849
    18501850        $objects = bp_nouveau_get_search_objects();
    18511851        if ( empty( $objects['primary'] ) || empty( $objects['secondary'] ) ) {
     1852                echo $search_form_html;
    18521853                return;
    18531854        }
    18541855
    18551856        if ( 'dir' === $objects['primary'] ) {
     1857                /**
     1858                 * Filter here to edit the HTML output of the directory search form.
     1859                 *
     1860                 * NB: This will take in charge the following BP Core Components filters
     1861                 *     - bp_directory_members_search_form
     1862                 *     - bp_directory_blogs_search_form
     1863                 *     - bp_directory_groups_search_form
     1864                 *
     1865                 * @since 1.9.0
     1866                 *
     1867                 * @param string $search_form_html The HTML output for the directory search form.
     1868                 */
     1869                echo apply_filters( "bp_directory_{$objects['secondary']}_search_form", $search_form_html );
     1870
    18561871                if ( 'activity' === $objects['secondary'] ) {
    18571872                        /**
Note: See TracChangeset for help on using the changeset viewer.