link.php
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* LearnDash LD30.
*
* @since 3.0.0
*
* @package LearnDash\Templates\LD30
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* LearnDash LD30 Displays a link to the relevant certificate if it exists
*
* This will have to be variable based on the current users context.
* Different information is passed in based on if they are on a course, lesson,
* topic etc...
*
* Having it in one place is advantagous over multiple instances of the status
* bar for Guttenburg block placement.
*
* Available Variables:
*
* $user_id : Current User ID
* $logged_in : User is logged in
* $current_user : (object) Currently logged in user object
*
* @since 3.0.0
*
* @package LearnDash\Templates\LD30\Modules
*/
/**
* Thought process:
*
* Have some function that checks for the existance of a post type specific
* variant of a template and falls back to a generic one if it doesn't
* exist.
*
* e.g
*
* get_contextualized_template( $slug, $string );
*
* if( file_exists( $slug . '-' . $string . '.php' ) ) {
* return $slug . '-' . $string . '.php';
* } else {
* return $slug . '-' . 'generic.php';
* }
*
*/
// No access to any certificates if you're not logged in.
if ( $logged_in ) {
// SFWD::get_template_part( 'modules/link', get_post_type() );
}