diff options
Diffstat (limited to 'plugins/jetpack/_inc/lib/core-api/load-wpcom-endpoints.php')
-rw-r--r-- | plugins/jetpack/_inc/lib/core-api/load-wpcom-endpoints.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/jetpack/_inc/lib/core-api/load-wpcom-endpoints.php b/plugins/jetpack/_inc/lib/core-api/load-wpcom-endpoints.php index 2b26f78c..f9e1fb44 100644 --- a/plugins/jetpack/_inc/lib/core-api/load-wpcom-endpoints.php +++ b/plugins/jetpack/_inc/lib/core-api/load-wpcom-endpoints.php @@ -35,6 +35,11 @@ function wpcom_rest_api_v2_load_plugin( $class_name ) { require dirname( __FILE__ ) . '/class-wpcom-rest-field-controller.php'; -// Now load the endpoint files. -wpcom_rest_api_v2_load_plugin_files( 'wpcom-endpoints/*.php' ); -wpcom_rest_api_v2_load_plugin_files( 'wpcom-fields/*.php' ); +/** + * Load the REST API v2 plugin files during the plugins_loaded action. + */ +function load_wpcom_rest_api_v2_plugin_files() { + wpcom_rest_api_v2_load_plugin_files( 'wpcom-endpoints/*.php' ); + wpcom_rest_api_v2_load_plugin_files( 'wpcom-fields/*.php' ); +} +add_action( 'plugins_loaded', 'load_wpcom_rest_api_v2_plugin_files' ); |