Wordpress custom url from plugin - wordpress

I want to be able to create url from plugin. for example. A new url would be http://example.com/slug-set-from-plugin which will output contents from plugin methods. Is it doable?

Use the Rewrite API, in your case: add_rewrite_endpoint(). See this example for detailed instructions.

Related

Symfony backend to Wordpress frontend

is there a way to send Symfony’s data from its action to Wordpress page?
For example Symfony’s action returns an array and in a Wordpress page I could iterate it?
Wordpress use template that are basic php file.
So you can make request to any rest api you want you using php. You can use your symfony rest api if you want.
Simply go in wordpress create pages and create template that will make your request to Symfony and display what you need.
It's really not recommanded but for a special case it could be possible.
You maybe should take the time to simply move your data in the wordpress DB.

Wordpress Plugin - Expose REST API

I'm trying to write a plugin that would add these endpoints GET, POST, DELETE /api/checked to access the plugin's custom table.
Is it possible for a Wordpress plugin to expose a RESTful API? I can't seem to find any examples or documentation.
The closest thing I found was add_rewrite_rule. I was able to create http://www.blog.com/api, but how do I determine the HTTP verb?
You can use WP REST API. Just install it and then go to settings -> permalink and add /%postname%/ on the last field.
then you'll have everything you need at [url]/json-api/
Here is the doc
You can use JSON-API WordPress plugin for creating the web-services that can be used for fetching the data from Wordpress.
And the plugin will provide the webservice url something like that :
www.mysite.com/api/servicename
Plugin link : https://wordpress.org/plugins/json-api/
Hope it helps you some extent.

Create public functions on a WordPress site (API behaviour)

Is that possible to create public function that we could access from another site, like a "custom API" on a WordPress site ?
For example, URL "my-wordpress.com/my_function" would return the code defined in my_function().
Thanks for answers,
Sébastien.
You can use the XMLRPC interface provided by WordPress.
See these links:
http://codex.wordpress.org/XML-RPC_Support
http://codex.wordpress.org/XML-RPC_Extending
This might be the right way to offer a custom API, but it doesn't allow you to simply call a function using a URL. Communication is done via XML that you send to the xmlrpc.php in your wordpress root.

Wordpress post with no URL / viewable web page

Is it possible to configure a WP post so that it has no URL / viewable web page. At that point it would essentially become a reusable content snippet that must be referenced elsewhere, from another page or post, but could not be linked to as its own page.
Thanks,
Keith
This plugin seems to achieve what you want. Searching the plugin repository with the term "Snippet" yielded this plugin.
You could also hack together something using custom page templates and pages.

How to get wordpress custom fields rss feed into zend?

My web site is based on zend framework that have wordpress blog. I want to get new post details in the site. Using zend Zend_Feed_Reader function I can get title, link, description ... But there is no method to get wordpress custom fields feed.
Is there any existing method or any other way to do that?
Thanks
Try to include wp-load.php in your zend site. This will give you access to everything in wordpress (functions, posts, meta) and you won't have to go out and retrieve an RSS feed to get it.

Resources