Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_search_form_type_select_options Doesn’t Trigger ??


  • vanleurth
    Participant

    @vanleurth

    Hi programmers,

    I have been trying to filter the buddypress search box to add another option but ..
    it doesn’t trigger.
    Here is my code at the top of functions.php of my theme

    add_filter( ‘bp_search_form_type_select_options’, ‘kendyman_seventeen_options’, 10, 1);

    function kendyman_seventeen_options( $options ) 
    {
    	
    		echo "here5";
    		exit();
      
    	$args = array(
    	                'orderby'    => 'name', /* ou id ou count .. */
    	                'order'      => 'ASC', /* ou DESC */
    			'include' => array( 1, 5 ) /* list of category ids to include */
    	              );
    
    	$cats = get_terms( 'category', $args );
    	
    	foreach( $cats as $term ){
    		$options['cat-'.$term->term_id] = $term->name;
    	}
    	
    	return $options;
    }

    Any ideas? I have searched all the forums and it seems no one is having this problem.
    Links to other forum posts will be great or comments

    Thank you,

    V.

Viewing 1 replies (of 1 total)

  • vanleurth
    Participant

    @vanleurth

    I forgot the filter. Here it is again;

    function kendyman_seventeen_options( $options ) 
    {
    	
    		echo "here5";
    		exit();
      
    	$args = array(
    	                'orderby'    => 'name', /* ou id ou count .. */
    	                'order'      => 'ASC', /* ou DESC */
    			'include' => array( 1, 5 ) /* list of category ids to include */
    	              );
    
    	$cats = get_terms( 'category', $args );
    	
    	foreach( $cats as $term ){
    		$options['cat-'.$term->term_id] = $term->name;
    	}
    	
    	return $options;
    }
    
    add_filter('bp_core_search_site', 'kendyman_seventeen_search_by_cat_url', 10, 2);
Viewing 1 replies (of 1 total)
  • The topic ‘bp_search_form_type_select_options Doesn’t Trigger ??’ is closed to new replies.
Skip to toolbar