if I print $_GET it return an empty array
Then there is nothing in $_GET. You should see $_GET variables in the browser address
if (isset($_GET['var1']))
echo "OK";
else
echo "There is no variable called 'var1' being passed.";
Hello Shane,
I called manually the URL in the browser with the ?var1=TEST to be sure that it’s called properly but nothing change.
I’m calling it from the buddypress-xprofile-custom-fields-type plugin, do you think could be some filter that intercept querystring and reset it ?
I’m calling it from the buddypress-xprofile-custom-fields-type plugin, do you think could be some filter that intercept querystring and reset it ?
I doubt it.
Where in the plugin are you calling it?
In a function?
And what is that function hooked to?
Is that hook being called on the page where you manually call the $_GET? Probably not.
Yes, I’m calling in to the public function edit_field_html
I’m sure it’s fired because I write the else condition and it goes into it.
The url is called with /index.php/members/userXX/profile/edit/?var1=aaaa
Hi @city4run
It might help if we see all of your code?
Hello Henry, take a look here http://pastebin.com/LB0E98hB
Hi @henrywright, did you take a look to the code ?
However I notice this: when I put the following code into the functions.php file, it return OK.
if ($_GET['var1']) {
echo "OK";
}
When I call the page using the BPress EDIT page URL http://www.mysite.com/index.php/members/userxxx/profile/edit/?var1=TEST
it seems to do a double page request because it says: Notice: Undefined index: var1 in functions.php
I also tried to add an EXIT and it show me the OK
if ($_GET['var1']) {
echo "OK";
exit();
}
using ?var1=test
in the URL, what does the following display?
if ( isset( $_GET['var1'] ) ) {
echo $_GET['var1'];
}
I put it into my code file and also into functions.php but always empty.
I changed it to:
if ( isset( $_GET['var1'] ) ) {
echo $_GET['var1'];
exit();
}
In my code file it return empty, into functions.php it return test
I put it into my code file and also into functions.php but always empty.
I think this indicates there is something weird going on. My advice is to remove all custom code, disable all plugins and revert back to TwentyFifteen theme. Then try again. If it works then, we can be sure you have something on your install that’s conflicting. The task is then to find out what.
Really thanks Henry, I’ll do this and I’ll let you know…