Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove IXR references #77

Merged
merged 2 commits into from

1 participant

Ryan McCue
Ryan McCue
Owner

Fixes #50.

Ryan McCue rmccue added this to the 0.9 milestone
Ryan McCue rmccue added the Bug label
Ryan McCue rmccue self-assigned this
Ryan McCue rmccue merged commit 5aacbab into from
Ryan McCue rmccue deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2014
  1. Ryan McCue

    Don't check for IXR_Error

    rmccue authored
  2. Ryan McCue

    Remove IXR includes

    rmccue authored
This page is out of date. Refresh to see the latest.
18 lib/class-wp-json-posts.php
View
@@ -214,18 +214,14 @@ function newPost( $data ) {
unset( $data['ID'] );
$result = $this->insert_post( $data );
- if ( is_string( $result ) || is_int( $result ) ) {
- $response = $this->getPost( $result );
- $response->set_status( 201 );
- $response->header( 'Location', json_url( '/posts/' . $result ) );
- return $response;
- }
- elseif ( $result instanceof IXR_Error ) {
- return new WP_Error( 'json_insert_error', $result->message, array( 'status' => $result->code ) );
- }
- else {
- return new WP_Error( 'json_insert_error', __( 'An unknown error occurred while creating the post' ), array( 'status' => 500 ) );
+ if ( $result instanceof WP_Error ) {
+ return $result;
}
+
+ $response = $this->getPost( $result );
+ $response->set_status( 201 );
+ $response->header( 'Location', json_url( '/posts/' . $result ) );
+ return $response;
}
/**
2  lib/wp-json.php
View
@@ -24,8 +24,6 @@
include('./wp-load.php');
include_once(ABSPATH . 'wp-admin/includes/admin.php');
-include_once(ABSPATH . WPINC . '/class-IXR.php');
-include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
include_once(ABSPATH . WPINC . '/class-wp-json-server.php');
// Allow for a plugin to insert a different class to handle requests.
2  plugin.php
View
@@ -80,8 +80,6 @@ function json_api_loaded() {
if ( empty( $GLOBALS['wp']->query_vars['json_route'] ) )
return;
- include_once( ABSPATH . WPINC . '/class-IXR.php' );
- include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' );
include_once( dirname( __FILE__ ) . '/lib/class-wp-json-server.php' );
/**
2  tests/test_json_server.php
View
@@ -24,8 +24,6 @@ function setUp() {
parent::setUp();
- include_once( ABSPATH . WPINC . '/class-IXR.php' );
- include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' );
include_once( plugin_dir_path( dirname( __FILE__ ) ) . 'lib/class-wp-json-server.php' );
// Allow for a plugin to insert a different class to handle requests.
Something went wrong with that request. Please try again.