menu_slug, array( $this, 'render_page' ), 1 ); } /** * Settings * * @param array $settings The settings. */ public function set_settings( $settings ) { $theme = wp_get_theme( get_template() ); // Hero. /* translators: Theme Name */ $this->settings['hero_title'] = sprintf( esc_html__( 'Welcome to %1$s', 'revision' ), $theme->get('Name') ); /* translators: Theme Name */ $this->settings['hero_desc'] = sprintf( esc_html__( '%1$s is now installed and activated. To help you with the next step, we\'ve gathered together on this page all the resources you might need. We hope you enjoy using this theme.', 'revision' ), $theme->get('Name') ); $this->settings['hero_image'] = __return_false(); // Documentation. $this->settings['documentation_link'] = sprintf( 'https://codesupply.co/documentation/%s/', $theme->get('TextDomain') ); // Changelog. $this->settings['changelog_link'] = sprintf( 'https://codesupply.co/documentation/%s/changelog/', $theme->get('TextDomain') ); // Support. $this->settings['support_link'] = 'https://codesupply.co/support/'; // Community. $this->settings['community_link'] = 'https://www.facebook.com/codesupplyco/'; } /** * Render Hero * * @param string $location The location. */ public function render_hero( $location = null ) { global $pagenow; $theme = wp_get_theme( get_template() ); $screen = get_current_screen(); ?>
display_name ); ?>
settings['hero_title'], 'content' ); ?>
settings['hero_desc'] ) && $this->settings['hero_desc'] ) { ?>
settings['hero_desc'], 'content' ); ?>
settings['hero_image'] ) && $this->settings['hero_image'] ) { ?>

render_hero(); ?>
$this->menu_slug, 'tab' => $tab_data['slug'], ), admin_url( 'themes.php' ) ); $tab_status = __return_empty_string(); if ( $active_tab === $tab_data['slug'] ) { $tab_status = 'cs-panel-tab-active'; } ?>
base ) { $transient_name = sprintf( '%s_hero_notice', get_template() ); if ( ! get_transient( $transient_name ) ) { ?>
render_hero( 'themes' ); ?>
', '' ), '', $script ) ); } /** * This function will register scripts and styles for admin dashboard. * * @param string $page Current page. */ public function admin_enqueue_scripts( $page ) { wp_enqueue_script( 'csco-theme-dashboard', get_theme_file_uri( '/core/theme-dashboard/assets/theme-dashboard.js' ), array( 'jquery' ), filemtime( get_theme_file_path( '/core/theme-dashboard/assets/theme-dashboard.js' ) ), true ); wp_localize_script( 'csco-theme-dashboard', 'cscoThemeDashboardConfig', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'nonce' ), 'failed_message' => esc_html__( 'Something went wrong, contact support.', 'revision' ), ) ); // Styles. wp_enqueue_style( 'csco-theme-dashboard', get_theme_file_uri( '/core/theme-dashboard/assets/theme-dashboard.css' ), array(), filemtime( get_theme_file_path( '/core/theme-dashboard/assets/theme-dashboard.css' ) ) ); // Add RTL support. wp_style_add_data( 'revision', 'rtl', 'replace' ); } } new CSCO_Theme_Dashboard(); }