Esempio n. 1
0
 function catch_vars()
 {
     global $bp, $wp_query;
     if (!class_exists('Vibe_CustomTypes_Permalinks')) {
         return;
     }
     $permalinks = Vibe_CustomTypes_Permalinks::init();
     if ($bp->unfiltered_uri[0] == trim($permalinks->permalinks['course_base'], '/') || $bp->unfiltered_uri[0] == BP_COURSE_SLUG) {
         $drive_slug = $this->permalinks['drive_slug'] ? $this->permalinks['drive_slug'] : 'drive';
         $drive_slug = str_replace('/', '', $drive_slug);
         if (get_query_var($drive_slug)) {
             $bp->current_component = BP_COURSE_CPT;
             $bp->current_item = get_The_ID();
             $bp->current_action = 'drive';
             add_action('bp_course_plugin_template_content', array($this, 'course_drive'));
             do_action('buddydrive_enqueue_scripts');
             vibe_load_template('course/single/plugins');
             exit;
         }
     }
 }
Esempio n. 2
0
 public static function init()
 {
     if (is_null(self::$instance)) {
         self::$instance = new Vibe_CustomTypes_Permalinks();
     }
     return self::$instance;
 }