Publish Wordpress Posts to external Database - php

I am developing a web application in Codeigniter (PHP) and I want to use Wordpress to do the admin side stuff for the application, like add new posts, Import data from files, etc. My application has a separate database of its own. How do I write the data published from the Wordpress Admin Dashboard into my applications Database?
In short, I need wordpress to write into two distinct databases when I hit the "Publish" button for a post.

You could use an WP Multi-User install with a plugin called Multi-post, that will allow you to save one post to multiple sites within the install.

You can do this by creating a cronjob, and check if some new post has been added to the WP database, and copy to your Codeigniter website database or any other needed operations can be done.

Related

Is there any function that can allow auto scheduling of posts using ckeditor in a website builth from php scratch?

I have a php website built from scratch, it has a ckeditor plugin for adding posts and videos to the website.
So, i'll like to know if there's a way to add scheduling post feature on Ckeditor, just like wordpress has. I just set a date and time for the post to go live, then the system handles everything for me automatically.

How to use Wordpress Functions on an external PHP - On any wordpress site, not only mine

I am working on a PHP program that does some tasks and then generates a text, this text must be able to be published later in a Wordpress (.org).
The Wordpress sites where it will publish are not mine and are not on my server so include wp-load or similar will not to work, for this, I will have in my database the login information (URL of the site, user, password).
I need to know how to connect from PHP and create the session in Wordpress.
After that, I need to get the list of categories of the blog and then publish the generated text in one of them. Can it be done directly or do I need to make a plugin for this? I don't have experience making plugins and wordpress Rest API, so if there is a direct way it would be better.

How to make Duplicate Posts and Pages in multi sites - Wordpress

I want to make duplicate posts and pages on wordpress either by functions or a plugin, any suggestions.
Also, i want to use these duplicacy for multi site functionality. That is, if i create another site, it may inherit the posts and pages of master site.
You can do this with the built in export/import feature. Under the tools menu in the admin menu you can find these two options. Just export the posts and pages XML file. Then on your new site or multisites you can import that XML file. You'll have an option to download all media on import also, which will bring over the images, PDFs, etc.
Here's the documentation:
http://codex.wordpress.org/Tools_Export_Screen
http://codex.wordpress.org/Tools_Import_Screen
I have a subsite that contains the base setup for a new site.I use the "Multisite Cloner" plugin on the master site to specify that 'template' subsite whenever new subsites are created.
For duplicating posts/pages, you could use the export/import process.
But there is now (4 years later from your question) a plugin that allows you to duplicate a page or post from one subsite to another: Multisite Post Duplicator (https://wordpress.org/plugins/multisite-post-duplicator/ ). I have not used it yet (although I will be testing it soon), but it has good reviews and appears to be maintained.
I add this info now (four years later) because this question came up in a search for a similar need.

WordPress Multisite - Create New Sites and Users through API?

I have created a Wordpress multisite and was wondering if it was possible to programatically add new sites (blogs) and users through the API?
Basically I have another website (ASP.Net C#) where I will be selling something and I want to give users a free blog everytime they buy something. So everytime a user registers on my other website I want to connect to wordpress multisite through the API and create a new blog for the user.
I have looked through some of the documentation on XML-RPC and saw stuff about adding new blog posts but is it possible to add actual blogs too? Or if not, is there any other way of doing this?
Hi: Like a year ago i had the same problem. Im not sure if it is possible to create it using the API. We solved at that time creating the tables automatically with php scripts. An easy way is to have the wordpress core tables, and everytime a new user register, you just copy the wp core tables into new wp tables but with a new prefix. That way you just personalize some fields like blog title.
You can contact me is you think I can help.

Good approach to adding a blog to my website

I've built a custom website on top of the codeigniter framework. I now want to implement a 'blog' section of my website and allow various non-technical people I work with to edit/create blog entries and post them. I don't want to create a backend for this from scratch.
Are there any good plugins for codeigniter that work with existing blog hosting services to perhaps download an xml-rss feed and construct this into a blog page? Not sure what the best approach is to offer this kind of functionality to nontechnical people I work with. Any suggestions?
If it's simply the admin interface you don't want to write again, I would:
Setup the blog on the same mysql server as your CodeIgniter app OR on a server with a static IP
Create another db connection from your app to the blog's database
Use CodeIgniter to handle data, routing and the frontend views
This will allow you to better integrate the frontend interface of the blog into your existing site while keeping the blog's backend.
If you don't (for some reason) want to create another connection, you could use the RSS feeds as an XML formatted API, or create an API layer on top of the blog. This option will definitely be slower than a direct connection, but you may prefer to do it this way.
Almost all blogs provide RSS. You could just consume that and cache it using an RSS Parser library.
I have a demo running right now using this method with Tumblr

Categories