コード例 #1
0
 /**
  * Returns singleton instance of CP_Custom_Taxonomy_Core
  *
  * @return CP_Custom_Taxonomy_Core
  */
 public static function GetInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new CP_Custom_Taxonomy_Core();
     }
     return self::$instance;
 }
コード例 #2
0
 /**
  * Default action for registering the taxonomy.
  *
  */
 public function register()
 {
     CP_Custom_Taxonomy_Core::GetInstance()->register_custom_taxonomy($this);
 }
コード例 #3
0
ファイル: cms-press.php プロジェクト: voceconnect/cms-press
    }
}
if (!version_compare(get_wp_version(), '2.9', '>=')) {
    trigger_error('CMS Press requires WP version 2.9 or higher', E_USER_NOTICE);
    return;
}
define('CP_BASE_DIR', dirname(__FILE__));
define('CP_BASE_URL', str_replace(str_replace('\\', '/', ABSPATH), site_url() . '/', str_replace('\\', '/', dirname(__FILE__))));
require_once CP_BASE_DIR . '/cp-custom-content/legacy/legacy.php';
/**
 * Core files
 */
require_once CP_BASE_DIR . '/cp-custom-content/cp-custom-content-core.php';
require_once CP_BASE_DIR . '/cp-custom-taxonomy/cp-custom-taxonomy-core.php';
CP_Custom_Content_Core::Initialize();
CP_Custom_Taxonomy_Core::Initialize();
/**
 * Add dynamic content type handler(s)
 */
require_once CP_BASE_DIR . '/child-plugins/dynamic/dynamic-content.php';
Dynamic_Content_Builder::Initialize();
require_once CP_BASE_DIR . '/child-plugins/dynamic/dynamic-taxonomies.php';
Dynamic_Taxonomy_Builder::Initialize();
function on_cmspress_activation()
{
    $role = get_role('administrator');
    if (!$role->has_cap('manage_content_types')) {
        $role->add_cap('manage_content_types');
    }
    if (!$role->has_cap('manage_taxonomies')) {
        $role->add_cap('manage_taxonomies');