Hey! Keep up to date with the project through its beta and public launch by following @getsparks.

 
2
2
0
400 Installs

Basic Information: ciwp

Fetching WordPress content from CodeIgniter

Contributor : fjallstrom
Email : Log in to view
Author Website : http://earthpeople.se
Spark Website : http://earthpeople.se/labs/2011/08/fetching-wordpress-content-from-codeigniter/
Repository Type : git
Number of Installs : 400

Get the Latest

  • 0.2.0 Pushed August 29th, 2011
    php tools/spark install -v0.2.0 ciwp Or download this version manually: Get ciwp-0.2.0.zip

How-To

CodeIgniter-WP

Fetch data from one or many WordPress installations. This is a very early version and quite rough. It only supports the methods below. More to come.

Requirements

  1. PHP 5.3+
  2. CodeIgniter 2.0.0 - 2.0.3

Usage

First - open up sparks/config/wp.php and tell the spark where you have your WordPress install root (ie where the wp-config.php is located on the server). Note that you need both file and mysql access to the WordPress installations. Next in your controller:

$this->load->spark('ciwp/0.1.0');
print_r($this->wp->get_post('blog', 1);
print_r($this->wp->get_installations());
print_r($this->wp->wp_get_recent_posts('blog', array()));
print_r($this->wp->get_post_meta('blog', array()));
print_r($this->wp->get_comments('blog',array()));
print_r($this->wp->get_children('blog',array()));
print_r($this->wp->wp_insert_post('blog',array()));
print_r($this->wp->wp_insert_comment('blog','array()));
print_r($this->wp->get_users('blog','array('include' => 1, 'exlude' => 3, 'number' => 5)));

Methods in this library will take the same arguments as the WordPress function in the Codex.

Wordpress Codex: http://codex.wordpress.org/

Older Versions

  • 0.1.0 Pushed August 29th, 2011
    php tools/spark install -v0.1.0 ciwp Or download this version manually: Get ciwp-0.1.0.zip
  • 0.0.8 Pushed August 26th, 2011
    php tools/spark install -v0.0.8 ciwp Or download this version manually: Get ciwp-0.0.8.zip
  • 0.0.7 Pushed August 26th, 2011
    php tools/spark install -v0.0.7 ciwp Or download this version manually: Get ciwp-0.0.7.zip

Comments

blog comments powered by Disqus