PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 2.0.6
Tutor LMS – eLearning and online course solution v2.0.6
3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.11 1.2.12 1.2.13 1.2.20 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.15 1.9.16 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.4.0 2.5.0 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / classes / Assets.php
tutor / classes Last commit date
Addons.php 4 years ago Admin.php 4 years ago Ajax.php 4 years ago Announcements.php 4 years ago Assets.php 4 years ago Backend_Page_Trait.php 4 years ago Course.php 4 years ago Course_Filter.php 4 years ago Course_List.php 4 years ago Course_Settings_Tabs.php 4 years ago Course_Widget.php 4 years ago Custom_Validation.php 4 years ago Dashboard.php 4 years ago FormHandler.php 4 years ago Frontend.php 4 years ago Gutenberg.php 4 years ago Input.php 4 years ago Instructor.php 4 years ago Instructors_List.php 4 years ago Lesson.php 4 years ago Options_V2.php 4 years ago Post_types.php 4 years ago Private_Course_Access.php 4 years ago Q_and_A.php 4 years ago Question_Answers_List.php 4 years ago Quiz.php 4 years ago Quiz_Attempts_List.php 4 years ago RestAPI.php 4 years ago Reviews.php 4 years ago Rewrite_Rules.php 4 years ago Shortcode.php 4 years ago Student.php 4 years ago Students_List.php 4 years ago Taxonomies.php 4 years ago Template.php 4 years ago Theme_Compatibility.php 5 years ago Tools.php 4 years ago Tools_V2.php 4 years ago Tutor.php 4 years ago TutorEDD.php 4 years ago Tutor_Base.php 5 years ago Tutor_List_Table.php 4 years ago Tutor_Setup.php 4 years ago Upgrader.php 4 years ago User.php 4 years ago Utils.php 4 years ago Video_Stream.php 4 years ago Withdraw.php 4 years ago Withdraw_Requests_List.php 4 years ago WooCommerce.php 4 years ago
Assets.php
526 lines
1 <?php
2
3 namespace TUTOR;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 class Assets {
10
11 public function __construct()
12 {
13 /**
14 * Common scripts loading
15 */
16 add_action('admin_enqueue_scripts', array($this, 'common_scripts'));
17 add_action('wp_enqueue_scripts', array($this, 'common_scripts'));
18 /**
19 * Front and backend script enqueue
20 */
21 add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
22 add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
23
24 add_action('admin_enqueue_scripts', array($this, 'load_meta_data'));
25 add_action('wp_enqueue_scripts', array($this, 'load_meta_data'));
26
27 /**
28 * Text domain loading
29 */
30 add_action( 'admin_enqueue_scripts', array( $this, 'tutor_script_text_domain' ), 100 );
31 add_action( 'wp_enqueue_scripts', array( $this, 'tutor_script_text_domain' ), 100 );
32 add_filter( 'tutor_localize_data', array( $this, 'modify_localize_data' ) );
33
34 /**
35 * register translatable function to load
36 * handled script with text domain attached to
37 *
38 * @since 1.9.0
39 */
40 add_action( 'admin_head', array( $this, 'tutor_add_mce_button' ) );
41 add_filter( 'get_the_generator_html', array( $this, 'tutor_generator_tag' ), 10, 2 );
42 add_filter( 'get_the_generator_xhtml', array( $this, 'tutor_generator_tag' ), 10, 2 );
43
44 /**
45 * Add translation support for external tinyMCE button
46 *
47 * @since 1.9.7
48 */
49 add_filter('mce_external_languages', array($this, 'tutor_tinymce_translate'));
50
51 /**
52 * Identifier class to body tag
53 *
54 * @since v1.9.9
55 */
56 add_filter( 'body_class', array( $this, 'add_identifier_class_to_body' ) );
57 add_filter( 'admin_body_class', array( $this, 'add_identifier_class_to_body' ) );
58
59 /**
60 * Add edit with front end builder button on Gutenberg editor
61 *
62 * @since v2.0.5
63 */
64 add_action( 'enqueue_block_editor_assets', __CLASS__ . '::add_frontend_editor_button' );
65 }
66
67 private function get_default_localized_data()
68 {
69 global $wp_version, $wp_query;
70
71 $home_url = get_home_url();
72 $parsed = parse_url($home_url);
73
74 $base_path = (is_array($parsed) && isset($parsed['path'])) ? $parsed['path'] : '/';
75 $base_path = rtrim($base_path, '/') . '/';
76
77 $post_id = get_the_ID();
78 $post_type = get_post_type( $post_id );
79
80 $query_vars = $wp_query->query_vars;
81 if ( is_admin() && isset( $_GET['page'] ) ) {
82 $current_page = $_GET['page'];
83 } else {
84 $current_page = isset( $query_vars['tutor_dashboard_page'] ) ? $query_vars['tutor_dashboard_page'] : '';
85 }
86 return array(
87 'ajaxurl' => admin_url( 'admin-ajax.php' ),
88 'home_url' => get_home_url(),
89 'site_title' => get_bloginfo( 'title' ),
90 'base_path' => tutor()->basepath,
91 'tutor_url' => tutor()->url,
92 'tutor_pro_url' => function_exists( 'tutor_pro' ) ? tutor_pro()->url : null,
93 'nonce_key' => tutor()->nonce,
94 tutor()->nonce => wp_create_nonce( tutor()->nonce_action ),
95 'loading_icon_url' => get_admin_url() . 'images/wpspin_light.gif',
96 'placeholder_img_src' => tutor_placeholder_img_src(),
97 'enable_lesson_classic_editor' => get_tutor_option( 'enable_lesson_classic_editor' ),
98 'tutor_frontend_dashboard_url' => tutor_utils()->get_tutor_dashboard_page_permalink(),
99 'wp_date_format' => tutor_js_date_format_against_wp(),
100 'is_admin' => is_admin(),
101 'is_admin_bar_showing' => is_admin_bar_showing(),
102 'addons_data' => tutor_utils()->prepare_free_addons_data(),
103 'current_user' => wp_get_current_user(),
104 'content_change_event' => 'tutor_content_changed_event',
105 'is_tutor_course_edit' => isset( $_GET[ 'action'] ) && 'edit' === $_GET['action'] && tutor()->course_post_type === get_post_type( get_the_ID() ) ? true : false,
106 'assignment_max_file_allowed' => 'tutor_assignments' === $post_type ? (int) tutor_utils()->get_assignment_option( $post_id, 'upload_files_limit' ) : 0,
107 'current_page' => $current_page,
108 );
109 }
110
111 public function admin_scripts()
112 {
113 wp_enqueue_style('tutor-select2', tutor()->url . 'assets/packages/select2/select2.min.css', array(), TUTOR_VERSION);
114 wp_enqueue_style('tutor-admin', tutor()->url . 'assets/css/tutor-admin.min.css', array(), TUTOR_VERSION);
115 /**
116 * Scripts
117 */
118 wp_enqueue_media();
119
120 wp_enqueue_script('wp-color-picker');
121 wp_enqueue_style('wp-color-picker');
122
123 wp_enqueue_script( 'jquery-ui-slider' );
124 wp_enqueue_script( 'jquery-ui-datepicker' );
125
126 wp_enqueue_script('tutor-select2', tutor()->url . 'assets/packages/select2/select2.full.min.js', array('jquery'), TUTOR_VERSION, true);
127 wp_enqueue_script('tutor-admin', tutor()->url . 'assets/js/tutor-admin.min.js', array('jquery', 'wp-color-picker', 'wp-i18n'), TUTOR_VERSION, true);
128 }
129
130 /**
131 * Load frontend scripts
132 */
133 public function frontend_scripts()
134 {
135 global $post, $wp_query;
136
137 /**
138 * We checked wp_enqueue_editor() in condition because it conflicting with Divi Builder
139 * condition updated @since v.1.7.4
140 */
141
142 if ( is_single() ) {
143 if ( function_exists( 'et_pb_is_pagebuilder_used' ) ) {
144 $is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() );
145 if ( ! $is_page_builder_used ) {
146 wp_enqueue_editor();
147 }
148 } else {
149 wp_enqueue_editor();
150 }
151 }
152
153 /**
154 * Initializing quicktags script to use in wp_editor();
155 */
156 wp_enqueue_script( 'quicktags' );
157
158 $tutor_dashboard_page_id = (int) tutor_utils()->get_option( 'tutor_dashboard_page_id' );
159 if ( $tutor_dashboard_page_id === get_the_ID() ) {
160 wp_enqueue_media();
161 }
162
163 /**
164 * Enabling Sorting, draggable, droppable...
165 */
166 wp_enqueue_script( 'jquery-ui-sortable' );
167 wp_enqueue_script( 'jquery-touch-punch', array('jquery-ui-sortable') );
168
169 // Plyr
170 if(is_single_course(true)) {
171 wp_enqueue_style('tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.css', array(), TUTOR_VERSION);
172 wp_enqueue_script('tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.polyfilled.min.js', array('jquery'), TUTOR_VERSION, true);
173 }
174
175 // Social Share
176 wp_enqueue_script('tutor-social-share', tutor()->url . 'assets/packages/SocialShare/SocialShare.min.js', array('jquery'), TUTOR_VERSION, true);
177
178 /**
179 * Chart Data
180 */
181 if (!empty($wp_query->query_vars['tutor_dashboard_page'])) {
182 wp_enqueue_script('jquery-ui-slider');
183
184 wp_enqueue_style('tutor-select2', tutor()->url . 'assets/packages/select2/select2.min.css', array(), TUTOR_VERSION);
185 wp_enqueue_script('tutor-select2', tutor()->url . 'assets/packages/select2/select2.full.min.js', array('jquery'), TUTOR_VERSION, true);
186
187 if ($wp_query->query_vars['tutor_dashboard_page'] === 'earning') {
188 wp_enqueue_script('tutor-front-chart-js', tutor()->url . 'assets/js/lib/Chart.bundle.min.js', array(), TUTOR_VERSION);
189 wp_enqueue_script('jquery-ui-datepicker');
190 }
191 }
192 /**
193 * dependency wp-i18n added for
194 * translate js file
195 *
196 * @since 1.9.0
197 */
198 wp_enqueue_style('tutor-frontend', tutor()->url . 'assets/css/tutor-front.min.css', array(), TUTOR_VERSION);
199 wp_enqueue_script('tutor-frontend', tutor()->url . 'assets/js/tutor-front.min.js', array('jquery', 'wp-i18n'), TUTOR_VERSION, true );
200
201 /**
202 * Load frontend dashboard style
203 *
204 * @since v1.9.8
205 */
206 if (tutor_utils()->is_tutor_frontend_dashboard()) {
207 wp_enqueue_style('tutor-frontend-dashboard-css', tutor()->url . 'assets/css/tutor-frontend-dashboard.min.css', TUTOR_VERSION);
208 }
209
210 // Load date picker for announcement at frontend
211 wp_enqueue_script( 'jquery-ui-datepicker' );
212 }
213
214 public function modify_localize_data($localize_data)
215 {
216 global $post;
217
218 if ( is_admin() ) {
219 if ( ! empty( $_GET['taxonomy'] ) && ( $_GET['taxonomy'] === 'course-category' || $_GET['taxonomy'] === 'course-tag' ) ) {
220 $localize_data['open_tutor_admin_menu'] = true;
221 }
222 } else {
223
224 // Assign quiz option
225 if (!empty($post->post_type) && $post->post_type === 'tutor_quiz') {
226 $single_quiz_options = (array) tutor_utils()->get_quiz_option($post->ID);
227 $saved_quiz_options = array(
228 'quiz_when_time_expires' => tutor_utils()->get_option('quiz_when_time_expires'),
229 );
230
231 $quiz_options = array_merge($single_quiz_options, $saved_quiz_options);
232
233 $previous_attempts = tutor_utils()->quiz_attempts();
234
235 if ($previous_attempts && count($previous_attempts)) {
236 $quiz_options['quiz_auto_start'] = 0;
237 }
238
239 $localize_data['quiz_options'] = $quiz_options;
240 }
241
242 // Including player assets if video exists
243 if ( tutor_utils()->has_video_in_single() ) {
244 $localize_data['post_id'] = get_the_ID();
245 $localize_data['best_watch_time'] = 0;
246
247 $best_watch_time = tutor_utils()->get_lesson_reading_info( get_the_ID(), 0, 'video_best_watched_time' );
248 if ( $best_watch_time > 0 ) {
249 $localize_data['best_watch_time'] = $best_watch_time;
250 }
251 }
252 }
253
254 return $localize_data;
255 }
256
257 public function common_scripts() {
258
259 // Fonts
260 wp_enqueue_style('tutor-icon', tutor()->url . 'assets/css/tutor-icon.min.css', array(), TUTOR_VERSION);
261
262 // Common css library
263 if ( is_rtl() ) {
264 wp_enqueue_style('tutor', tutor()->url . 'assets/css/tutor.rtl.min.css', array(), TUTOR_VERSION);
265 } else {
266 wp_enqueue_style('tutor', tutor()->url . 'assets/css/tutor.min.css', array(), TUTOR_VERSION);
267 }
268
269 // Load course builder resources
270 if (tutor_utils()->get_course_builder_screen()) {
271 wp_enqueue_script('tutor-course-builder', tutor()->url . 'assets/js/tutor-course-builder.min.js', array('jquery', 'wp-i18n'), TUTOR_VERSION, true);
272 wp_enqueue_style('tutor-course-builder-css', tutor()->url . 'assets/css/tutor-course-builder.min.css', array(), TUTOR_VERSION);
273 }
274 /**
275 * Load tutor common scripts both backend and frontend
276 *
277 * @since v2.0.0
278 */
279 wp_enqueue_script('tutor-script', tutor()->url . 'assets/js/tutor.min.js', array('jquery', 'wp-i18n'), TUTOR_VERSION, true);
280 }
281
282 public function load_meta_data()
283 {
284 // Localize scripts
285 $localize_data = apply_filters('tutor_localize_data', $this->get_default_localized_data());
286 wp_localize_script('tutor-frontend', '_tutorobject', $localize_data);
287 wp_localize_script('tutor-admin', '_tutorobject', $localize_data);
288 wp_localize_script('tutor-course-builder', '_tutorobject', $localize_data);
289 wp_localize_script('tutor-script', '_tutorobject', $localize_data);
290
291 // Inline styles
292 wp_add_inline_style('tutor-frontend', $this->load_color_palette());
293 wp_add_inline_style('tutor-admin', $this->load_color_palette());
294 }
295
296 private function load_color_palette()
297 {
298 $colors = array(
299 'tutor_primary_color' => '--tutor-color-primary',
300 'tutor_primary_hover_color' => '--tutor-color-primary-hover',
301 'tutor_text_color' => '--tutor-body-color',
302 'tutor_border_color' => '--tutor-border-color',
303 'tutor_gray_color' => '--tutor-color-gray',
304 );
305
306 // admin colors
307 $admin_colors = [];
308 if (is_admin()) {
309 $admin_color = get_user_option( 'admin_color' );
310
311 switch ($admin_color) {
312 case 'light':
313 $admin_color_codes = ['#04a4cc', '#04b0db'];
314 break;
315
316 case 'modern':
317 $admin_color_codes = ['#3858e9', '#4664eb'];
318 break;
319
320 case 'blue':
321 $admin_color_codes = ['#e1a948', '#e3af55'];
322 break;
323
324 case 'coffee':
325 $admin_color_codes = ['#c7a589', '#ccad93'];
326 break;
327
328 case 'ectoplasm':
329 $admin_color_codes = ['#a3b745', '#a9bd4f'];
330 break;
331
332 case 'midnight':
333 $admin_color_codes = ['#e14d43', '#e35950'];
334 break;
335
336 case 'ocean':
337 $admin_color_codes = ['#9ebaa0', '#a7c0a9'];
338 break;
339
340 case 'sunrise':
341 $admin_color_codes = ['#dd823b', '#df8a48'];
342 break;
343
344 default:
345 $admin_color_codes = ['#007cba', '#006ba1'];
346 break;
347 }
348
349 $admin_colors = [
350 '--tutor-color-primary' => $admin_color_codes[0],
351 '--tutor-color-primary-hover' => $admin_color_codes[1],
352 ];
353 }
354
355 $fallback_colors = [
356 'tutor_primary_color' => '#3E64DE',
357 'tutor_primary_hover_color' => '#395BCA',
358 'tutor_text_color' => '#212327',
359 'tutor_border_color' => '#E3E5EB',
360 'tutor_gray_color' => '#CDCFD5'
361 ];
362
363 $color_string = '';
364 foreach ($colors as $key => $property) {
365 $fallback_color = isset( $fallback_colors[$key] ) ? $fallback_colors[$key] : '#212327';
366 $color = tutor_utils()->get_option( $key, $fallback_color );
367 $color_rgb = tutor_utils()->hex2rgb( $color );
368
369 if (is_admin() && isset($admin_colors[$property])) {
370 $color = $admin_colors[$property];
371 $color_rgb = tutor_utils()->hex2rgb( $admin_colors[$property] );
372 }
373
374 if ($color) {
375 $color_string .= $property . ':' . $color . ';';
376 }
377
378 if ($color_rgb) {
379 $color_string .= $property . '-rgb:' . $color_rgb . ';';
380 }
381 }
382
383 return ':root{' . $color_string . '}';
384 }
385
386 /**
387 * Add Tinymce button for placing shortcode
388 */
389 function tutor_add_mce_button()
390 {
391 // check user permissions
392 if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
393 return;
394 }
395 // check if WYSIWYG is enabled
396 if ('true' == get_user_option('rich_editing')) {
397 add_filter('mce_external_plugins', array($this, 'tutor_add_tinymce_js'));
398 add_filter('mce_buttons', array($this, 'tutor_register_mce_button'));
399 }
400 }
401 // Declare script for new button
402 function tutor_add_tinymce_js($plugin_array)
403 {
404 $plugin_array['tutor_button'] = tutor()->url . 'assets/js/lib/mce-button.js';
405 return $plugin_array;
406 }
407 // Register new button in the editor
408 function tutor_register_mce_button($buttons)
409 {
410 array_push($buttons, 'tutor_button');
411 return $buttons;
412 }
413
414 /**
415 * Output generator tag to aid debugging.
416 *
417 * @param string $gen Generator.
418 * @param string $type Type.
419 * @return string
420 */
421 function tutor_generator_tag($gen, $type)
422 {
423 switch ($type) {
424 case 'html':
425 $gen .= "\n" . '<meta name="generator" content="TutorLMS ' . TUTOR_VERSION . '">';
426 break;
427 case 'xhtml':
428 $gen .= "\n" . '<meta name="generator" content="TutorLMS ' . TUTOR_VERSION . '" />';
429 break;
430 }
431 return $gen;
432 }
433
434 /**
435 * load text domain handled script after all enqueue_scripts
436 * registered functions
437 *
438 * @since 1.9.0
439 */
440 function tutor_script_text_domain() {
441 wp_set_script_translations( 'tutor-frontend', 'tutor', tutor()->path . 'languages/' );
442 wp_set_script_translations( 'tutor-admin', 'tutor', tutor()->path . 'languages/' );
443 wp_set_script_translations( 'tutor-course-builder', 'tutor', tutor()->path . 'languages/' );
444 }
445
446 /**
447 * Add translation support for external tinyMCE button
448 *
449 * @since 1.9.7
450 */
451 function tutor_tinymce_translate() {
452 $locales['tutor_button'] = tutor()->path . 'includes/tinymce_translate.php';
453 return $locales;
454 }
455
456 public function add_identifier_class_to_body($classes)
457 {
458 $course_builder_screen = tutor_utils()->get_course_builder_screen();
459 $to_add = array('tutor-lms');
460
461 // Add backend course editor identifier class to body
462 if ($course_builder_screen) {
463 $to_add[] = is_admin() ? 'tutor-backend' : '';
464 $to_add[] = ' tutor-screen-course-builder tutor-screen-course-builder-' . $course_builder_screen . ' ';
465 }
466
467 // Add frontend course builder identifier class
468 if (!$course_builder_screen && tutor_utils()->is_tutor_frontend_dashboard()) {
469 $to_add[] = 'tutor-screen-frontend-dashboard';
470 }
471
472 if (is_admin()) {
473 $screen = function_exists('get_current_screen') ? get_current_screen() : null;
474 $base = ($screen && is_object($screen) && property_exists($screen, 'base')) ? $screen->base : '';
475 $index = strpos($base, 'tutor');
476
477 if($index===0 || $index>0) {
478 $to_add[] = 'tutor-backend';
479
480 if (isset($_GET['page']) && $_GET['page'] == 'tutor_settings') {
481 $to_add[] = 'tutor-screen-backend-settings ';
482 }
483 if (isset($_GET['page'])) {
484 $to_add[] = 'tutor-backend-' . $_GET['page'];
485 }
486 }
487 }
488
489 // Remove duplicate classes if any
490 $to_add = array_unique($to_add);
491
492 if(is_array($classes)) {
493 $classes = array_merge($classes, $to_add);
494 } else {
495 $classes .= implode(' ', $to_add);
496 }
497
498 return $classes;
499 }
500
501 /**
502 * Enqueue script for adding edit with frontend course builder button
503 * on the Gutenberg editor
504 *
505 * @since v2.0.5
506 *
507 * @return void
508 */
509 public static function add_frontend_editor_button() {
510 $wp_screen = get_current_screen();
511
512 if ( is_a( $wp_screen, 'WP_Screen' ) && tutor()->course_post_type === $wp_screen->post_type ) {
513 wp_enqueue_script( 'tutor-gutenberg', tutor()->url . 'assets/js/tutor-gutenberg.min.js', array(), TUTOR_VERSION, true );
514 $data = array(
515 'frontend_dashboard_url' => esc_url( trailingslashit( tutor_utils()->tutor_dashboard_url( 'create-course' ) ) ) . '?course_ID=' . get_the_ID(),
516 );
517
518 wp_add_inline_script(
519 'tutor-gutenberg',
520 'const tutorInlineData =' . json_encode( $data ),
521 'before'
522 );
523 }
524 }
525 }
526