Newer
Older
return civi_wp()->civicrm_in_wordpress();
}
/**
* This was the original name of the initialization function and is
* retained for backward compatibility.
*
* @since 4.3
*
* @return bool True if CiviCRM is initialized, false otherwise.
*/
function civicrm_wp_initialize() {
return civi_wp()->initialize();
}
/**
* Initialize CiviCRM. Call this function from other modules too if
* they use the CiviCRM API.
*
* @since 4.3
*
* @return bool True if CiviCRM is initialized, false otherwise.
*/
function civicrm_initialize() {
return civi_wp()->initialize();
}
/**
* Callback from 'edit_post_link' hook to remove edit link in civicrm_set_post_blank().
*
* @since 4.3
*
* @return string Always empty.
*/
function civicrm_set_blank() {
return civi_wp()->clear_edit_post_link();
}
/**
* Authentication function used by civicrm_wp_frontend().
*
* @since 4.3
*
* @param array $args The page arguments array.
* @return bool True if authenticated, false otherwise.
*/
function civicrm_check_permission( $args ) {
return civi_wp()->users->check_permission( $args );
}
/**
* Called when authentication fails in civicrm_wp_frontend().
*
* @since 4.3
*
* @return string Warning message.
*/
function civicrm_set_frontendmessage() {
return civi_wp()->users->get_permission_denied();
}
/**
* Invoke CiviCRM in a WordPress context.
*
* Callback function from add_menu_page().
* Callback from WordPress 'init' and 'the_content' hooks.
* Also used by civicrm_wp_shortcode_includes() and _civicrm_update_user().
*
* @since 4.3
*/
function civicrm_wp_invoke() {
civi_wp()->invoke();
}
/**
* Method that runs only when civicrm plugin is activated.
*/
function civicrm_activate() {
civi_wp()->activate();
}
/**
* Set WordPress user capabilities.
*
* Function to create anonymous_user' role, if 'anonymous_user' role is not in
* the wordpress installation and assign minimum capabilities for all wordpress roles.
* This function is called on plugin activation and also from upgrade_4_3_alpha1().
*
* @since 4.3
*/
function civicrm_wp_set_capabilities() {
civi_wp()->users->set_wp_user_capabilities();
}
/**
* Callback function for add_options_page() that runs the CiviCRM installer.
*
* @since 4.3
*/
function civicrm_run_installer() {
civi_wp()->run_installer();
}
/**
* Function to get the contact type.
*
* @since 4.3
*
* @param string $default The contact type.
* @return string $ctype The contact type.
*/
function civicrm_get_ctype( $default = NULL ) {
return civi_wp()->users->get_civicrm_contact_type( $default );
}
/**
* Getter function for global $wp_set_breadCrumb.
*
* Called by appendBreadCrumb() in civicrm/CRM/Utils/System/WordPress.php
*
* @since 4.3
*
* @return string $wp_set_breadCrumb The breadcrumb markup.
*/
function wp_get_breadcrumb() {
global $wp_set_breadCrumb;
return $wp_set_breadCrumb;
}
/**
* Setter function for global $wp_set_breadCrumb.
*
* Called by appendBreadCrumb() in civicrm/CRM/Utils/System/WordPress.php
* Called by resetBreadCrumb() in civicrm/CRM/Utils/System/WordPress.php
*
* @since 4.3
*
* @param string $breadCrumb The desired breadcrumb markup.
* @return string $wp_set_breadCrumb The breadcrumb markup.
*/
function wp_set_breadcrumb( $breadCrumb ) {
global $wp_set_breadCrumb;
$wp_set_breadCrumb = $breadCrumb;
return $wp_set_breadCrumb;
}
/**
* Incorporate WP-CLI Integration.
*
* Based on drush civicrm functionality, work done by Andy Walker.
// Changed from __DIR__ because of possible symlink issues
include_once CIVICRM_PLUGIN_DIR . 'wp-cli/civicrm.php';
}