golden hour
/var/www/html/wp-content/plugins/designthemes-webinar/modules/google-classroom
⬆️ Go Up
Upload
File/Folder
Size
Actions
assets
-
Del
OK
register-module.php
3.9 KB
Del
OK
settings
-
Del
OK
templates
-
Del
OK
utils-backend.php
1.66 KB
Del
OK
utils-common.php
2.09 KB
Del
OK
Edit: register-module.php
<?php if (!class_exists ( 'DtWebinarGoogleClassRoom' )) { class DtWebinarGoogleClassRoom extends DtWebinar { /** * Instance variable */ private static $_instance = null; /** * Instance * * Ensures only one instance of the class is loaded or can be loaded. */ public static function instance() { if ( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } function __construct() { $this->dtwebinar_define_constants( 'DTWEBINAR_GCR_PLUGIN_PATH', DTWEBINAR_PLUGIN_PATH . 'modules/google-classroom/' ); $this->dtwebinar_define_constants( 'DTWEBINAR_GCR_PLUGIN_URL', DTWEBINAR_PLUGIN_URL . 'modules/google-classroom/' ); require_once DTWEBINAR_GCR_PLUGIN_PATH . 'assets/api/vendor/autoload.php'; require_once DTWEBINAR_GCR_PLUGIN_PATH . 'utils-backend.php'; require_once DTWEBINAR_GCR_PLUGIN_PATH . 'utils-common.php'; add_action ( 'admin_menu', array ( $this, 'dtwebinar_configure_admin_menu_module' ), 20 ); add_action ( 'admin_enqueue_scripts', array ( $this, 'dtwebinar_backend_enqueue_scripts' ), 100 ); add_action ( 'wp_enqueue_scripts', array ( $this, 'dtwebinar_frontend_enqueue_scripts' ), 100 ); add_filter ( 'theme_page_templates', array ( $this, 'dtwebinar_module_add_new_page_template' ) ); add_filter ( 'template_include', array ( $this, 'dtwebinar_modules_template_include' ) ); } function dtwebinar_configure_admin_menu_module() { add_submenu_page( 'dtwebinar-google-classroom', esc_html__('Google Classroom', 'dtwebinar'), esc_html__('Google Classroom', 'dtwebinar'), 'manage_options', 'dtwebinar-google-classroom', 'dtwebinar_gcr_settings', 1 ); require_once DTWEBINAR_GCR_PLUGIN_PATH . 'settings/index.php'; } /** * Backend enqueue scripts */ function dtwebinar_backend_enqueue_scripts() { wp_register_style ( 'dtwebinar-backend', DTWEBINAR_GCR_PLUGIN_URL . 'assets/css/backend.css', array () ); wp_register_script ( 'dtwebinar-backend', DTWEBINAR_GCR_PLUGIN_URL . 'assets/js/backend.js', array (), false, true ); wp_localize_script ( 'dtwebinar-backend', 'dtwebinarbackendobject', array ( 'ajaxurl' => admin_url('admin-ajax.php') )); $current_screen = get_current_screen(); if($current_screen->id == 'toplevel_page_dtwebinar-google-classroom') { wp_enqueue_style ( 'dtwebinar-backend' ); wp_enqueue_script ( 'dtwebinar-backend' ); } } /** * Frontend enqueue scripts */ function dtwebinar_frontend_enqueue_scripts() { wp_register_style ( 'dtwebinar-frontend', DTWEBINAR_GCR_PLUGIN_URL . 'assets/css/frontend.css', array () ); wp_register_script ( 'dtwebinar-frontend', DTWEBINAR_GCR_PLUGIN_URL . 'assets/js/frontend.js', array (), false, true ); wp_localize_script ( 'dtwebinar-frontend', 'dtwebinarfrontendobject', array ( 'textCopied' => esc_html__('Code Copied!', 'groca') )); wp_enqueue_style ( 'dtwebinar-frontend' ); wp_enqueue_script ( 'dtwebinar-frontend' ); } /** * Register template for courses listings */ function dtwebinar_module_add_new_page_template( $templates ) { $templates = array_merge ( $templates, array ( 'tpl-google-classroom.php' => esc_html__('Google Classroom Template', 'dtwebinar') ) ); return $templates; } function dtwebinar_modules_template_include( $template ) { if( is_singular('page') ) { global $post; $id = $post->ID; $file = get_post_meta( $post->ID, '_wp_page_template', true ); if( 'tpl-google-classroom.php' == $file ) { if( ! file_exists( get_stylesheet_directory() . '/tpl-google-classroom.php' ) ) { $template = DTWEBINAR_GCR_PLUGIN_PATH . 'templates/tpl-google-classroom.php'; } } } return $template; } } } if( !function_exists('dtRegisterGoogleClassRoomModule') ) { function dtRegisterGoogleClassRoomModule() { return DtWebinarGoogleClassRoom::instance(); } } dtRegisterGoogleClassRoomModule(); ?>
Save