This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds a view all posts page to any archive. | |
* | |
* @author Thomas Scholz http://toscho.de | |
* @version 1.1 | |
* @license: GPL2 | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Manage WordPress contact fields. | |
* Usage: | |
require './class.TTT_Contactfields.php'; | |
$TTT_Contactfields = new TTT_Contactfields( | |
array ( | |
'Twitter' | |
, 'Facebook' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$postTitle = $_POST['post_title']; | |
$post = $_POST['post']; | |
$submit = $_POST['submit']; | |
if(isset($submit)){ | |
global $user_ID; | |
$new_post = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using Wordpress XMLRPC services Jul 5th, 2009 | By admin | Category: Featured, PHP, Tutorials | |
(1 votes, average: 4.00 out of 5) | |
Wordpress is a great blogging platform. With tons of plugins available, Wordpress is quickly become a good choice not only for personal blogging purpose but also for making content oriented sites. There are also many sites want to add ‘blog’ feature into it and WP one more time is the chosen one. Although WP’s plugin architecture is really not good, the WP’s team have added in a really interesting tool that help integration between WP blog and hosting site easier. It’s XMLRPC services. | |
Here are some scenarios if you has a WP blog and you want to integrate it with another site, you will found XMLRPC helpful: | |
Showing latest posts/comments on the site homepage | |
Provide links to categories in your blog | |
Turning your WP blog into a collaborative environment for your site’s authors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Settings API Example | |
Plugin URI: http://wpengineer.com/ | |
Description: Complete and practical example of use of the Settings API to add fields on the Writing option page | |
Author: Ozh | |
Author URI: http://ozh.org/ | |
*/ | |
// We'll use ozhwpe (Ozh / WP Engineer) as a prefix throughout the plugin | |
// Register and define the settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. Get MySQL settings from web host. | |
* You can find more information by visiting the Codex page: | |
* | |
* @link http://codex.wordpress.org/Editing_wp-config.php | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("IXR_Library.php.inc"); | |
$client->debug = true; //Set it to false in Production Environment | |
$title="Blog Title"; // $title variable will insert your blog title | |
$body="Blog Content"; // $body will insert your blog content (article content) | |
$category="category1, category2"; // Comma seperated pre existing categories. Ensure that these categories exists in your blog. | |
$keywords="keyword1, keyword2, keyword3"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Update a Selected Post | |
$title= "Updated Title"; // The Title of the Post | |
$bodycontent="Updated Blog Article Content"; // Article Content | |
$categoriesu= array('Category1', 'Category2'); // Pre Existing Categories - Updated | |
$tagsu="tag1, tag2, $tag3"; // Updated Tags | |
$content = array('title'=>$title, 'description'=>$bodycontent,'categories'=>$categoriesu,'mt_keywords'=>$tagsu); | |
$params = array(163,$username,$password,$content,1); // First Parameter is mandatory Post Id (get your post id via Recent Blogs entries) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_time_limit(0); | |
require_once("IXR_Library.php.inc"); | |
$client->debug = true; // Set it to fase in Production Environment | |
// Create the client object | |
$client = new IXR_Client('Your Blog URL/xmlrpc.php'); | |
$username = "Blog Admin/Editor/Author User Name"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$categories=array(1)){ | |
$categories = implode(",", $categories); | |
$XML = "<title>$title</title>". | |
"<category>$categories</category>". | |
$body; | |
$params = array('','',$username,$password,$XML,1); | |
$request = xmlrpc_encode_request('blogger.newPost',$params); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $request); |