Advanced Post Privacy isn't running because the configuration file isn't readable, or doesn't exist.
$coreModule) { foreach (glob(APP_PATH . '/' . $coreModule['directory'] . '/*') as $coreModuleFile) { require_once($coreModuleFile); } } return self; } public static function loadExclusionModules() { $jsonConfig = self::$_json_config['advancedPostPrivacy']; foreach ($jsonConfig['exclusionModules'] as $moduleName => $exclusionModule) { $modulePathExpr = APP_PATH . '/' . $exclusionModule['directory']; foreach (glob($modulePathExpr . '/*.php') as $exclusionModuleFile) { if (strpos($exclusionModuleFile, 'settings.php') === false) { include_once($exclusionModuleFile); } } foreach (glob($modulePathExpr . '/ajax/*.php') as $ajaxFile) { include_once($ajaxFile); } } return self; } public static function getExclusionModuleData($dataKey, $exclusionModuleClass=null) { if ($exclusionModuleClass !== null) { $exclusionModuleData = self::$_json_config['advancedPostPrivacy']['exclusionModules'][$exclusionModuleClass]; // var_dump($exclusionModuleData); // var_dump($dataKey); if (array_key_exists($dataKey, (array) $exclusionModuleData)) { return $exclusionModuleData[$dataKey]; } else { return false; } } else { $exclusionModuleData = array(); foreach (self::$_json_config['advancedPostPrivacy']['exclusionModules'] as $exclusionModule => $data) { $exclusionModuleData[] = $data[$dataKey]; } return $exclusionModuleData; } } /** * Gets all options from extending classes optionName method, and makes * sure to delete them on uninstall of APP. * @return void */ public static function appUninstall() { do_action('adv_pp_uninstall'); foreach (self::$_json_config['advancedPostPrivacy']['exclusionModules'] as $moduleClass => $value) { $moduleOption = call_user_func($moduleClass . '::optionName'); delete_option($moduleOption); } } /** * Registers the APP options page with WP. * @return void */ public static function menuPage() { add_options_page('Advanced Post Privacy - Settings', 'Advanced Post Privacy', 'manage_options', 'advanced-post-privacy-settings', 'advancedPostPrivacy::settingsMenuPage'); } /** * Includes the settings menu page. * @return void */ public static function settingsMenuPage() { include_once(APP_DESIGN_PATH . '/settings.php'); } /** * Adds all bypassed posts to "the_posts" hook. * @param [type] $thePosts [description] */ public static function addBypassedPosts($thePosts) { $bypassedPostIds = self::getBypassedPostIds(); foreach ($bypassedPostIds as $postId) { $thePosts[] = get_post($postId); } $jankyUniquePosts = array(); foreach ($thePosts as $k => $thePost) { if (!in_array($thePost->ID, $jankyUniquePosts)) { $jankyUniquePosts[] = $thePost->ID; } else { unset($thePosts[$k]); } } // @todo- Make so much less janky. return $thePosts; } /** * Because of where is_singular becomes available, we remove * bypassed posts at the start of the loop here, as long as * it isn't the actual post being looped over. * @return [type] */ public static function removeExtraPosts() { if (!is_singular()) { return false; } $bypassedPostIds = advancedPostPrivacy::getBypassedPostIds(); global $wp_query, $posts; $post = $wp_query->get_queried_object(); foreach ($posts as $key => $val) { if (in_array($val->ID, $bypassedPostIds) && $val->ID != $post->ID) { unset($posts[$key]); } } return; } /** * Takes an array of post type slugs and gets all private post IDs * in the post types. * @param string|array $postTypeSlugs One or more post type slugs. * @return array Array of post IDs. */ public static function getPrivatePostIdsFromPostTypes($postTypeSlugs) { global $wpdb; $postTypeSlugs = (array) $postTypeSlugs; $privatePostIds = array(); foreach ($postTypeSlugs as $postTypeSlug) { $postTypePrivateIds = $wpdb->get_col( $wpdb->prepare("select ID from $wpdb->posts where post_status = 'private' and post_type = '%s'", $postTypeSlug)); $privatePostIds = array_merge($privatePostIds, $postTypePrivateIds); } return $privatePostIds; } /** * Gets all bypassed post IDs by going through all the classes in * the config file, and calls getExcludedPostIds on them to merge. * @return array Post Ids meant to be bypassed */ public static function getBypassedPostIds() { $bypassedPostIds = array(); $jsonConfig = self::$_json_config['advancedPostPrivacy']; foreach ($jsonConfig['exclusionModules'] as $exclusionClass => $exclusionModuleData) { $excludedPostIds = call_user_func($exclusionClass . '::' . 'getExcludedPostIds'); $bypassedPostIds = array_merge($bypassedPostIds, $excludedPostIds); } $bypassedPostIds = array_unique($bypassedPostIds); $bypassedPostIds = apply_filters('adv_pp_bypassed_post_ids', $bypassedPostIds); return array_unique($bypassedPostIds); } }