id, $dashboard_pages ) ) {
$classes .= ' generate-dashboard-page';
}
return $classes;
}
/**
* Build our Dashboard header.
*/
public static function header() {
?>
array(
'name' => __( 'Dashboard', 'generatepress' ),
'url' => admin_url( 'themes.php?page=generate-options' ),
'class' => 'appearance_page_generate-options' === $screen->id ? 'active' : '',
),
)
);
if ( ! defined( 'GP_PREMIUM_VERSION' ) ) {
$tabs['premium'] = array(
'name' => __( 'Premium', 'generatepress' ),
'url' => 'https://generatepress.com/premium',
'class' => '',
'external' => true,
);
}
$tabs['support'] = array(
'name' => __( 'Support', 'generatepress' ),
'url' => 'https://generatepress.com/support',
'class' => '',
'external' => true,
);
$tabs['documentation'] = array(
'name' => __( 'Documentation', 'generatepress' ),
'url' => 'https://docs.generatepress.com',
'class' => '',
'external' => true,
);
?>
id, $dashboard_pages ) ) {
self::header();
/**
* generate_dashboard_after_header hook.
*
* @since 2.0
*/
do_action( 'generate_dashboard_after_header' );
}
}
/**
* Add our scripts to the page.
*/
public function enqueue_scripts() {
$dashboard_pages = self::get_pages();
$current_screen = get_current_screen();
if ( in_array( $current_screen->id, $dashboard_pages ) ) {
wp_enqueue_style(
'generate-dashboard',
get_template_directory_uri() . '/assets/dist/style-dashboard.css',
array( 'wp-components' ),
GENERATE_VERSION
);
if ( 'appearance_page_generate-options' === $current_screen->id ) {
wp_enqueue_script(
'generate-dashboard',
get_template_directory_uri() . '/assets/dist/dashboard.js',
array( 'wp-api', 'wp-i18n', 'wp-components', 'wp-element', 'wp-api-fetch' ),
GENERATE_VERSION,
true
);
wp_set_script_translations( 'generate-dashboard', 'generatepress' );
wp_localize_script(
'generate-dashboard',
'generateDashboard',
array(
'hasPremium' => defined( 'GP_PREMIUM_VERSION' ),
'customizeSectionUrls' => array(
'siteIdentitySection' => admin_url( 'customize.php?autofocus[section]=title_tagline' ),
'colorsSection' => admin_url( 'customize.php?autofocus[section]=generate_colors_section' ),
'typographySection' => admin_url( 'customize.php?autofocus[section]=generate_typography_section' ),
'layoutSection' => admin_url( 'customize.php?autofocus[panel]=generate_layout_panel' ),
),
)
);
}
}
}
/**
* Add the HTML for our page.
*/
public function page() {
?>
';
}
/**
* Add the container for our start customizing app.
*/
public function go_pro() {
echo '';
}
/**
* Add the container for our reset app.
*/
public function reset() {
echo '';
}
}
GeneratePress_Dashboard::get_instance();