Title: shortcode with parameters
Last modified: July 7, 2022

---

# shortcode with parameters

 *  Resolved [Cacique](https://wordpress.org/support/users/carlosjavier10/)
 * (@carlosjavier10)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/shortcode-with-parameters-4/)
 * First of all good morning, I need to display a directory with hidden filter where
   the members of each country that I set as an extra field in buddypress are displayed,
   the hidden filter “profile search” works very well, but I am forced to create
   60 pages for the 60 countries, it occurred to me to pass to a single page the
   name of the country as a parameter by get, but I can not make it work, I tried
   adding a small shortcode to receive the parameter and also to print the shortcode
   directly but none of that worked! I am not an expert (obviously) but it would
   be a lot of abuse if you give me some idea of how to achieve this? thank you 
   very much in advance.
 * in short, the idea is to use your shortcode but with parameter. example: [bps_directory
   field_24=”($PARAMETER) “]
 * Thank you very much in advance, I hope it doesn’t bother too much.
 * Translated with [http://www.DeepL.com/Translator](http://www.DeepL.com/Translator)(
   free version)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fshortcode-with-parameters-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Andrea Tarantini](https://wordpress.org/support/users/dontdream/)
 * (@dontdream)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/shortcode-with-parameters-4/#post-15807987)
 * Hi carlosjavier10,
 * Instead of using [bps_directory] you could use the ‘bps_hidden_filters’ hook,
   as follows:
 *     ```
       add_filter ('bps_hidden_filters', 'my_hidden_filters');
       function my_hidden_filters ($filters)
       {
       	if (!empty ($_GET['country']))
       		$filters['field_24'] = $_GET['country'];
       	return $filters;
       }
       ```
   
 * Add the above code to your _bp-custom.php_ file, then call your members directory:
 * [https://iwkassociation.com/members/?country=France](https://iwkassociation.com/members/?country=France)
 *  Thread Starter [Cacique](https://wordpress.org/support/users/carlosjavier10/)
 * (@carlosjavier10)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/shortcode-with-parameters-4/#post-15809086)
 * Here in my land we say “NA GUARA” when something impresses us a lot, and NAGUARA
   Andrea you are a SUN, thank you very much indeed! i tried it in local and it 
   worked the first time. now i am going to take it to the domain. thank you very
   much.
 *  Plugin Author [Andrea Tarantini](https://wordpress.org/support/users/dontdream/)
 * (@dontdream)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/shortcode-with-parameters-4/#post-15810962)
 * You’re welcome, thanks for your kind words!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘shortcode with parameters’ is closed to new replies.

 * ![](https://ps.w.org/bp-profile-search/assets/icon.svg?rev=1568973)
 * [BP Profile Search](https://wordpress.org/plugins/bp-profile-search/)
 * [Support Threads](https://wordpress.org/support/plugin/bp-profile-search/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-profile-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-profile-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-profile-search/reviews/)

## Tags

 * [directories](https://wordpress.org/support/topic-tag/directories/)
 * [Profile search](https://wordpress.org/support/topic-tag/profile-search/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [user](https://wordpress.org/support/topic-tag/user/)

 * 3 replies
 * 2 participants
 * Last reply from: [Andrea Tarantini](https://wordpress.org/support/users/dontdream/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/shortcode-with-parameters-4/#post-15810962)
 * Status: resolved