is_free_plan()) { require_once STP_PLUGIN_PATH . 'admin/inc/metabox-free.php'; require_once STP_PLUGIN_PATH . 'public/shortcode-free.php'; } if (str_fs()->can_use_premium_code__premium_only() && file_exists(STP_PLUGIN_PATH . 'premium-files/metabox-pro.php')) { require_once STP_PLUGIN_PATH . 'premium-files/metabox-pro.php'; require_once STP_PLUGIN_PATH . 'premium-files/shortcode-pro.php'; require_once STP_PLUGIN_PATH . 'premium-files/widgets.php'; require_once STP_PLUGIN_PATH . 'premium-files/blocks/index.php'; require_once STP_PLUGIN_PATH . 'premium-files/assets.php'; } if (str_fs()->can_use_premium_code__premium_only() && !file_exists(STP_PLUGIN_PATH . 'premium-files/shortcode-pro.php')) { require_once STP_PLUGIN_PATH . 'public/shortcode-free.php'; } } private static function setup_hooks() { add_action('plugins_loaded', [__CLASS__, 'load_textdomain']); add_action('admin_enqueue_scripts', [__CLASS__, 'enqueue_admin_assets']); add_action('admin_menu', [__CLASS__, 'add_help_pages']); add_filter('admin_footer_text', [__CLASS__, 'admin_footer']); add_shortcode('stream', [__CLASS__, 'stream_shortcode']); } public static function load_textdomain() { load_plugin_textdomain('streamcast', false, dirname(__FILE__) . "/../languages"); } public static function enqueue_admin_assets($hook) { global $typenow; if ('streamcast' === $typenow) { wp_enqueue_script('stp-admin-post-js', STP_PLUGIN_DIR . 'build/admin-post.js', [], STP_PLUGIN_VERSION, true); wp_enqueue_style('stp-admin-post-css', STP_PLUGIN_DIR . 'build/admin-post.css', [], STP_PLUGIN_VERSION); } if ('streamcast_page_help' === $hook) { wp_enqueue_style('stp-admin', STP_PLUGIN_DIR . 'admin/css/admin.css', [], STP_PLUGIN_VERSION); } elseif ('streamcast_page_dashboard' === $hook) { wp_enqueue_script('stp-dashboard-js', STP_PLUGIN_DIR . 'build/admin-help.js', ['react', 'react-dom'], STP_PLUGIN_VERSION, true); wp_enqueue_script('stp-fs-js', STP_PLUGIN_DIR . 'public/js/fs.js', [], STP_PLUGIN_VERSION, true); wp_enqueue_style('tlgb-dashboard-css', STP_PLUGIN_DIR . 'build/admin-help.css', [], STP_PLUGIN_VERSION); } } public static function add_help_pages() { add_submenu_page( 'edit.php?post_type=streamcast', 'Getting Started', 'Getting Started', 'manage_options', 'help', [__CLASS__, 'render_help_page'] ); add_submenu_page( 'edit.php?post_type=streamcast', 'Demo & Help', 'Demo & Help', 'manage_options', 'dashboard', [__CLASS__, 'render_dashboard'] ); } public static function render_help_page() { include_once STP_PLUGIN_PATH . 'admin/whats-new.php'; } public static function render_dashboard() { ?>
StreamCast Radio Player plugin, please leave us a ★★★★★ rating.', 'streamcast'), $url); } return $text; } public static function stream_shortcode($atts) { extract(shortcode_atts([ 'url' => null, 'background' => null, ], $atts)); ob_start(); ?>