Solved

get var? after hashtag from url

Posted on 2014-11-20
2
166 Views
Last Modified: 2014-11-20
I used to have  a wordpress plugin that, when being used, would include a ? in the url.

I would test for that var it used, and adjust my code accordingly, to display certain things, like this:

if ( isset( $wp_query->query_vars['sample'] ) ) {

I just updated the plugin and now, instead of having a ?, then have a hashtag, and then the var I need to look for.

Apparently, my 'if' is not triggered anymore, so I'm thinking the change makes it not a query var.

So... with it as a hashtag, how can I write an if for it?

Thanks for any help,

Chris
0
Comment
Question by:St_Aug_Beach_Bum
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40456626
Anything after the hashtag is only available at the browser and is not sent back to the server.
Your only real option is, depending on the scenario, use js to get the hashtag and store it in an input, for example if you were submitting a form, so you can grab the input value at the server.
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40456639
Ohh... bummer. Yeh, going to have to rethink this.

The plugin author has been very receptive to feedback, I'll ask her to see if she can give me a better solution.

Thank you very much!

Chris
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now