Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/07/2018 09:48:52 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

Fixes #7881 (trunk)

File:
1 edited

Legend:

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

    r12178 r12184  
    18501850 */
    18511851function bp_nouveau_search_form() {
    1852     bp_get_template_part( 'common/search/search-form' );
     1852    $search_form_html = bp_buffer_template_part( 'common/search/search-form', null, false );
    18531853
    18541854    $objects = bp_nouveau_get_search_objects();
    18551855    if ( empty( $objects['primary'] ) || empty( $objects['secondary'] ) ) {
     1856        echo $search_form_html;
    18561857        return;
    18571858    }
    18581859
    18591860    if ( 'dir' === $objects['primary'] ) {
     1861        /**
     1862         * Filter here to edit the HTML output of the directory search form.
     1863         *
     1864         * NB: This will take in charge the following BP Core Components filters
     1865         *     - bp_directory_members_search_form
     1866         *     - bp_directory_blogs_search_form
     1867         *     - bp_directory_groups_search_form
     1868         *
     1869         * @since 1.9.0
     1870         *
     1871         * @param string $search_form_html The HTML output for the directory search form.
     1872         */
     1873        echo apply_filters( "bp_directory_{$objects['secondary']}_search_form", $search_form_html );
     1874
    18601875        if ( 'activity' === $objects['secondary'] ) {
    18611876            /**
Note: See TracChangeset for help on using the changeset viewer.