Skip to content
Snippets Groups Projects
Verified Commit baed88e5 authored by Andrei Mondoc's avatar Andrei Mondoc Committed by Kevin Cristiano
Browse files

prevent clash with CiviCRM WP REST plugin

parent d04385be
No related branches found
No related tags found
No related merge requests found
...@@ -523,8 +523,10 @@ class CiviCRM_For_WordPress { ...@@ -523,8 +523,10 @@ class CiviCRM_For_WordPress {
include_once CIVICRM_PLUGIN_DIR . 'includes/civicrm.basepage.php'; include_once CIVICRM_PLUGIN_DIR . 'includes/civicrm.basepage.php';
$this->basepage = new CiviCRM_For_WordPress_Basepage; $this->basepage = new CiviCRM_For_WordPress_Basepage;
// Include REST API autoloader class if ( ! class_exists( 'CiviCRM_WP_REST\Autoloader' ) ) {
require_once( CIVICRM_PLUGIN_DIR . 'wp-rest/Autoloader.php' ); // Include REST API autoloader class
require_once( CIVICRM_PLUGIN_DIR . 'wp-rest/Autoloader.php' );
}
} }
...@@ -650,11 +652,15 @@ class CiviCRM_For_WordPress { ...@@ -650,11 +652,15 @@ class CiviCRM_For_WordPress {
// Register hooks for clean URLs. // Register hooks for clean URLs.
$this->register_hooks_clean_urls(); $this->register_hooks_clean_urls();
// Set up REST API. if ( ! class_exists( 'CiviCRM_WP_REST\Plugin' ) ) {
CiviCRM_WP_REST\Autoloader::add_source( $source_path = trailingslashit( CIVICRM_PLUGIN_DIR . 'wp-rest' ) );
// Set up REST API.
CiviCRM_WP_REST\Autoloader::add_source( $source_path = trailingslashit( CIVICRM_PLUGIN_DIR . 'wp-rest' ) );
// Init REST API. // Init REST API.
new CiviCRM_WP_REST\Plugin; new CiviCRM_WP_REST\Plugin;
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment