How do I add my PHP app to a WordPress page whilst keeping semantic URLs?

Its not good way to edit .htaccess for wordpress url rewriting (only for main urls settings from admin panel) You found your response here : API basic url rewriting or The Rewrite API: Post Types & Taxonomies An example : add_action( ‘init’, ‘rewrite_rule’ ); function rewrite_rule() { global $wp,$wp_rewrite; // Remember to flush the rules … Read more

Using the WordPress and WooCommerce REST APIs in the same Node app

I thought I’d share my solution for anyone working on a similar problem. I ended up switching to node-wpapi and using REST Autodiscovery to enable use of the WooCommerce & WordPress APIs from a single library. This can be done like so: const wpapi = require(‘wpapi’) let wp = new wpapi({ endpoint: ‘http://your.wp.site/wp-json/’, username: ‘user’, … Read more

Setting a JSON web token from a secondary api as a secure cookie on WordPress

Seems odd to answer my own question, but in case it is of use to someone, this is the answer. To make an ajax call to a plugin, and receive the response correctly you must register that endpoint with the plugin. This allows you to sidestep the protection WordPress is putting in your way. I’m … Read more

Possibility of including third party software/plugins in the WordPress repository

License Compatibility As a recent commenter pointed out on my site, it should be possible to distribute a plug-in that’s not GPL so long as you don’t distribute it with WordPress. However, the guys at WP.org have pointed out time and again that only GPL-compatible plug-ins must be compatible with version 2 of the GPL. … Read more

REST alert when new WordPress post is published or updated

Use the HTTP API to send a “ping” on the wp_insert_post action, which is fired whenever a post is created/updated: /** * @param int $post_id The ID of the post. * @param WP_Post $post The post object. * @param bool $update True if the post already exists and is being updated */ function wpse_185340_post_ping( $post_id, … Read more