This repository was archived by the owner on Apr 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.php
More file actions
99 lines (78 loc) · 1.99 KB
/
Copy pathfunctions.php
File metadata and controls
99 lines (78 loc) · 1.99 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/**
* Course functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Course
* @since Course 1.0
*/
if ( ! function_exists( 'course_support' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since Course 1.0
*
* @return void
*/
function course_support() {
add_theme_support( 'sensei-learning-mode' );
// Enqueue editor styles.
add_editor_style( 'style.css' );
add_editor_style( 'learning-mode.css' );
}
endif;
add_action( 'after_setup_theme', 'course_support' );
if (!function_exists( 'course_scripts' )) :
/**
* Enqueue scripts and styles.
*
* @since Course 1.0
*
* @return void
*/
function course_scripts() {
// Register theme stylesheet.
wp_register_style(
'course-style',
get_stylesheet_directory_uri() . '/style.css',
array(),
wp_get_theme()->get( 'Version' )
);
wp_register_style(
'course-sensei-learning-mode',
get_stylesheet_directory_uri() . '/learning-mode.css',
array(),
wp_get_theme()->get(
'Version'
)
);
// Enqueue theme stylesheet.
wp_enqueue_style( 'course-style' );
// TODO: Only Load it if the the page is using learning mode
wp_enqueue_style( 'course-sensei-learning-mode' );
// Enqueque theme scripts.
wp_enqueue_script( 'course-header', get_template_directory_uri() . '/assets/js/header.js', [], wp_get_theme()->get( 'Version' ), true );
}
endif;
add_action( 'wp_enqueue_scripts', 'course_scripts' );
function course_theme_init() {
register_block_style(
'core/navigation-link',
array(
'name' => 'navigation-link-button',
'label' => __( 'Button', 'course' ),
)
);
}
add_action( 'init', 'course_theme_init' );
/**
* Register Sensei LMS block patterns category.
*/
function course_register_block_patterns_category() {
register_block_pattern_category(
'sensei-lms',
[ 'label' => 'Sensei LMS' ]
);
}
add_action( 'init', 'course_register_block_patterns_category' );