Merge pull request #196 from jeherve/fix/fatal-api
Avoid Fatal Errors when Core REST API classes don't exist.
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class SP_REST_Posts_Controller extends WP_REST_Posts_Controller {
|
if ( class_exists( 'WP_REST_Posts_Controller' ) ) {
|
||||||
public function __construct( $post_type ) {
|
class SP_REST_Posts_Controller extends WP_REST_Posts_Controller {
|
||||||
parent::__construct( $post_type );
|
public function __construct( $post_type ) {
|
||||||
$this->namespace = 'sportspress/v2';
|
parent::__construct( $post_type );
|
||||||
|
$this->namespace = 'sportspress/v2';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class SP_REST_Terms_Controller extends WP_REST_Terms_Controller {
|
if ( class_exists( 'WP_REST_Terms_Controller' ) ) {
|
||||||
public function __construct( $taxonomy ) {
|
class SP_REST_Terms_Controller extends WP_REST_Terms_Controller {
|
||||||
parent::__construct( $taxonomy );
|
public function __construct( $taxonomy ) {
|
||||||
$this->namespace = 'sportspress/v2';
|
parent::__construct( $taxonomy );
|
||||||
|
$this->namespace = 'sportspress/v2';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user