Skip to:
Content
Pages
Categories
Search
Top
Bottom

Customize Groups From Search

  • @frenchwebmaster

    Participant

    Hello there !

    I recently want to customize a bit my group search form adding severals fields.
    As we can’t override it, I do the following things :

    In my theme /group/index.php replacing like that :

    
     do_action('bp_directory_groups_search_form');//bp_directory_groups_search_form(); 
    

    In order to create a custom form in a plugin like that :

    
    /**
    		 *	Function used to show the groups search form.
    		 */
            function bp_custom_search_form () {
    
    			global $bp;
    
                    // Define the search form    
     
                    ?>
                    // My form with fields here 	
                    <?php
            }
            add_filter('bp_directory_groups_search_form', 'bp_custom_search_form');
    

    I hooked the bp_has_groups() function in order to override the search getting my form params :

    
    // Function used to filter groups after a search request.
    		function bp_custom_search_action($args = '') {
    			
    			global $bp;
    			global $wpdb;
    			
    			// Get all corresponding groups
    			// Trying here to get my $_POST parameters
    		}
    		add_filter( 'bp_has_groups', 'bp_custom_search_action');
    

    But impossible to get my $_POST parameters here.
    My params form seem to no be send, I really don't understand that.

    Maybe there is another way to do that.

    Thanks a lot !

  • The topic ‘Customize Groups From Search’ is closed to new replies.
Skip to toolbar