Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How can i add query_var to custom buddypress page? WordPress


I added a new page to buddypress with <strong>bp_core_new_subnav_item</strong>.
Lets say its adress:

I want this page to handle a custom query_var. While its working like this:
but its not working like this:

I tried to use <strong>bp_pre_user_query_construct</strong> but couldnt success. Any ideas?

I asked same question in [[LINK href=""]]buddypress forum[[/LINK]] and got a tip:

<blockquote>Look at <strong>$bp->action_variables</strong> array</blockquote>

I couldnt find an example. I want an example code for this.

Answers (1)


Dbranes answers:

Did you try to create an <em>endpoint</em> (untested), for example:

function wpq_add_endpoint() {
add_rewrite_endpoint( 'query', EP_PAGES );
add_action( 'init', 'wpq_add_endpoint' );

See the Codex:

PS: Maybe the following plugin can give you a hint how to add endpoints in BP:

[[LINK href=""]][[/LINK]]

√únsal Korkmaz comments:

I am sorry but i really need a working example