plugin_name = $plugin_name; $this->version = $version; } /** * Register the stylesheets for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_styles() { // Only load on download page if (!is_page('shared-file-download')) { return; } wp_enqueue_style( $this->plugin_name . '-public', plugin_dir_url(dirname(__FILE__)) . 'public/css/public.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_scripts() { // Only load on download page if (!is_page('shared-file-download')) { return; } wp_enqueue_script( $this->plugin_name . '-public', plugin_dir_url(dirname(__FILE__)) . 'public/js/public.js', array('jquery'), $this->version, true ); } /** * Create download page if it doesn't exist. * * @since 1.0.0 */ public function create_download_page() { $download_page = get_page_by_path('shared-file-download'); if (!$download_page) { wp_insert_post(array( 'post_title' => __('Shared File Download', 'qdr-temporary-shared-storage'), 'post_content' => '[qdr_tss_download]', 'post_status' => 'publish', 'post_type' => 'page', 'post_name' => 'shared-file-download' )); } } }