Esempio n. 1
0
 public static function init()
 {
     if (is_null(self::$instance)) {
         self::$instance = new WPLMS_tips();
     }
     return self::$instance;
 }
Esempio n. 2
0
         } else {
             echo '<input id="course_id" type="hidden" value="' . $_GET['id'] . '"><a href="' . get_permalink($_GET['id']) . '?action=curriculum" class="course_button button full">' . __('Back to Course', 'vibe') . '</a>';
         }
     } else {
         echo '<input id="course_id" type="hidden" value="' . $_GET['id'] . '"><a href="' . get_permalink($_GET['id']) . '?action=curriculum" class="course_button button full">' . __('Back to Course', 'vibe') . '</a>';
     }
 } else {
     global $wpdb;
     $uid = get_the_ID();
     $course_id = '';
     if (function_exists('bp_course_get_unit_course_id')) {
         $course_id = bp_course_get_unit_course_id($uid);
     }
     if (is_numeric($course_id) && get_post_type($course_id) == 'course') {
         $extension = '';
         $settings = WPLMS_tips::init();
         if (!empty($settings->settings) && empty($settings->settings['course_curriculum_below_description'])) {
             $permalinks = get_option('vibe_course_permalinks');
             $curriculum_slug = !empty($permalinks['drive_slug']) ? $permalinks['curriculum_slug'] : 'curriculum';
             if (!empty($curriculum_slug)) {
                 $extension = $curriculum_slug . '/';
             }
         }
         echo '<input id="course_id" type="hidden" value="' . $course_id . '"><a href="' . get_permalink($course_id) . $extension . '" class="course_button button full">' . __('Back to Course', 'vibe') . '</a>';
     } else {
         vibe_breadcrumbs();
     }
 }
 ?>
     </div>
 </div>
Esempio n. 3
0
 function admin_slugs($slug)
 {
     $tips = WPLMS_tips::init();
     if (empty($tips->settings['revert_permalinks'])) {
         $admin_slug = str_replace('/', '', $this->permalinks['admin_slug']);
         switch ($slug) {
             case '?action=admin':
                 $slug = $admin_slug;
                 break;
             case '?action=admin&submissions':
                 if (!empty($this->permalinks['submissions_slug'])) {
                     $slug = $admin_slug . $this->permalinks['submissions_slug'];
                 }
                 break;
             case '?action=admin&stats':
                 if (!empty($this->permalinks['stats_slug'])) {
                     $slug = $admin_slug . $this->permalinks['stats_slug'];
                 }
                 break;
         }
     }
     return $slug;
 }