|
@@ 7-9 (lines=3) @@
|
| 4 |
|
// /sites/%s/connections |
| 5 |
|
function callback( $path = '', $blog_id = 0 ) { |
| 6 |
|
// Verify required Publicize Jetpack module is active |
| 7 |
|
if ( ! class_exists( 'Publicize' ) || ( method_exists( 'Jetpack', 'is_module_active' ) && ! Jetpack::is_module_active( 'publicize' ) ) ) { |
| 8 |
|
return new WP_Error( 'missing_jetpack_module', 'The Publicize module must be activated in order to use this endpoint.', 400 ); |
| 9 |
|
} |
| 10 |
|
|
| 11 |
|
// Authenticate user |
| 12 |
|
$blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ), false ); |
|
@@ 99-101 (lines=3) @@
|
| 96 |
|
// /sites/%s/connections/$connection_id |
| 97 |
|
function callback( $path = '', $blog_id = 0, $connection_id = 0 ) { |
| 98 |
|
// Verify required Publicize Jetpack module is active |
| 99 |
|
if ( ! class_exists( 'Publicize' ) || ( method_exists( 'Jetpack', 'is_module_active' ) && ! Jetpack::is_module_active( 'publicize' ) ) ) { |
| 100 |
|
return new WP_Error( 'missing_jetpack_module', 'The Publicize module must be activated in order to use this endpoint.', 400 ); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
$blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ), false ); |
| 104 |
|
if ( is_wp_error( $blog_id ) ) { |
|
@@ 133-135 (lines=3) @@
|
| 130 |
|
// /sites/%s/connections/$connection_id/delete |
| 131 |
|
function callback( $path = '', $blog_id = 0 , $connection_id = 0 ) { |
| 132 |
|
// Verify required Publicize Jetpack module is active |
| 133 |
|
if ( ! class_exists( 'Publicize' ) || ( method_exists( 'Jetpack', 'is_module_active' ) && ! Jetpack::is_module_active( 'publicize' ) ) ) { |
| 134 |
|
return new WP_Error( 'missing_jetpack_module', 'The Publicize module must be activated in order to use this endpoint.', 400 ); |
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
$blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ), false ); |
| 138 |
|
if ( is_wp_error( $blog_id ) ) { |