function scoper_init() { global $scoper; // Work around bug in More Taxonomies (and possibly other plugins) where category taxonomy is overriden without setting it public foreach (array('category', 'post_tag') as $taxonomy) { if (isset($GLOBALS['wp_taxonomies'][$taxonomy])) { $GLOBALS['wp_taxonomies'][$taxonomy]->public = true; } } if (IS_MU_RS && agp_is_plugin_network_active(SCOPER_BASENAME)) { global $scoper_sitewide_options; $scoper_sitewide_options = apply_filters('sitewide_options_rs', $scoper_sitewide_options); } require_once dirname(__FILE__) . '/wp-cap-helper_cr.php'; WP_Cap_Helper_CR::establish_status_caps(); WP_Cap_Helper_CR::force_distinct_post_caps(); WP_Cap_Helper_CR::force_distinct_taxonomy_caps(); if (is_admin()) { require_once dirname(__FILE__) . '/admin/admin-init_rs.php'; // TODO: why is the require statement up top not sufficient for NGG 1.7.2 uploader? scoper_admin_init(); } //log_mem_usage_rs( 'scoper_admin_init done' ); require_once dirname(__FILE__) . '/scoped-user.php'; require_once dirname(__FILE__) . '/role-scoper_main.php'; //log_mem_usage_rs( 'require role-scoper_main' ); if (empty($scoper)) { // set_current_user may have already triggered scoper creation and role_cap load $scoper = new Scoper(); //log_mem_usage_rs( 'new Scoper done' ); $scoper->init(); } // ensure that content administrators (as defined by SCOPER_CONTENT_ADMIN_CAP) have all caps for custom types by default if (is_content_administrator_rs()) { global $current_rs_user; if (!empty($current_rs_user)) { // user object not set when scoper_init() is manually invoked to support htaccess rule generation on plugin activation foreach (get_post_types(array('public' => true, '_builtin' => false)) as $name) { $current_rs_user->assigned_blog_roles[ANY_CONTENT_DATE_RS]["rs_{$name}_editor"] = true; } $taxonomies = get_taxonomies(array('public' => true, '_builtin' => false)); $taxonomies[] = 'nav_menu'; foreach ($taxonomies as $name) { $current_rs_user->assigned_blog_roles[ANY_CONTENT_DATE_RS]["rs_{$name}_manager"] = true; } $current_rs_user->merge_scoped_blogcaps(); $GLOBALS['current_user']->allcaps = array_merge($GLOBALS['current_user']->allcaps, $current_rs_user->allcaps); $GLOBALS['current_user']->assigned_blog_roles = $current_rs_user->assigned_blog_roles; } } if (!empty($_GET['action']) && 'expire_file_rules' == $_GET['action']) { require_once dirname(__FILE__) . '/attachment-helper_rs.php'; scoper_requested_file_rule_expire(); } //log_mem_usage_rs( 'scoper->init() done' ); }