techxplorer
Forum Replies Created
-
Forum: Plugins
In reply to: How do I Pass a parameter into plugin via get requestAt the moment I must confess that I’m not sure if there is a standardised way of doing AJAX type things in the public interface of a WordPress install.
I do know that all the components are there, for example the ability to include various JavaScript libraries that are bundled with WordPress dynamically, including loading your own external JavaScript libraries to act as the glue between it all.
As yet though I haven’t explored it too deeply. I’ve been working on other projects. Which interestingly enough appear to required some form of AJAX in admin pages. So in theory the same basic principles should be the same.
My suggestion is to start by looking into either libraries made available by default via the wp_enqueue_script function.
Sorry I can’t be of much more help at the moment
Forum: Plugins
In reply to: How do I Pass a parameter into plugin via get requestI must admit I don’t know.
In my initial investigation I only needed one parameter. What I’m going to do now is use AJAX to dynamically draw my content on the page instead. Which means I don’t have to worry about parameters any more.
Sorry I can’t be of any more help.
Forum: Plugins
In reply to: How do I Pass a parameter into plugin via get requestYes, the url to my-page/ is already being rewritten, it is a page in the WordPress system, as distinct from a post. I think I’ve worked out what I need to do.
If I retrieve the URL of the request $_SERVER[‘REQUEST_URI’] I can determine if URLs are being rewritten. Based on my testing so far:
– If the URL contains a ?page_id= then it is not being written and I can append my parameter onto the end and use the standard $_GET variable to get it. For example
mydomain.com/index.php?page_id=15&my_var=10
– If the URL does not contain ?page_id then it is being rewritten and I can append my parameter onto the end of it in a different way and still get it via the $_GET variable. For example:
mydomain.com/my_page?my_var=10
So far in my test both methods are working.
Many thanks for your help.
-techxplorer
Forum: Plugins
In reply to: How do I Pass a parameter into plugin via get requestYes, your right. That will work. What I am trying to work out is how do I pass a parameter to a plugin that is running inside WordPress itself.
– I have a plugin that is rewriting some content in a page stored with WordPress accessed via the following URL
mydomain.com/my-page/
What I want to do is have URLs like this so I can pass a parameter into the plugin
mydomain.com/my-page/?my-id=10
There are two issues here.
A. I’m not sure how the rewrite rules would affect this, because the only reason I can use this type of URL is I have permalinks configured
B. I’m not sure how it would work if I didn’t have permalinks running.
With thanks
-techxplorer