is__premium_only() && cc_fs()->can_use_premium_code() ) { $premium_status = true; } } return $premium_status; } function saaslauncher_get_theme_initial( $name ) { // Split the name into words. $words = explode( ' ', $name ); // Use array_slice to take the first letters of each word. $initials = ''; foreach ( array_slice( $words, 0 ) as $word ) { if ( ! empty( $word ) ) { $initials .= strtoupper( $word[0] ); } } return $initials; } function saaslauncher_get_dashboard_pages_order(): array { $pages_dir = SAASLAUNCHER_DIR . 'inc/admin/pages'; // Fetch all PHP files in the /pages directory. $pages = glob( $pages_dir . '/*.php' ); // Define your custom order by file names. $custom_order = array( 'getting-started.php', 'recommended-plugins.php', 'setup-instructions.php', 'free-vs-pro.php', 'pre-built-demos.php', 'support.php', 'activate-licence.php', 'changelog.php', ); // Sort the fetched pages based on custom order usort( $pages, function ( $a, $b ) use ( $custom_order ) { $a_basename = basename( $a ); $b_basename = basename( $b ); $a_index = array_search( $a_basename, $custom_order, true ); $b_index = array_search( $b_basename, $custom_order, true ); return $a_index - $b_index; } ); return $pages; } $theme_name = wp_get_theme()->get( 'Name' ); $theme_version = wp_get_theme()->get( 'Version' ); $theme_initial = saaslauncher_get_theme_initial( $theme_name ); $pages_order = saaslauncher_get_dashboard_pages_order(); // Define custom labels for specific files. $custom_page_labels = array( 'pre-built-demos.php' => 'Pre-Built Demos', ); ?>

$dashboard_page ) { $filename = basename( $dashboard_page ); $pages_dir = SAASLAUNCHER_DIR . 'inc/admin/pages/'; $file_path = $pages_dir . $filename; // Check if the file exists and is readable. if ( file_exists( $file_path ) && is_readable( $file_path ) ) { $classes = array(); $classes[] = 'saaslauncher-content-item'; $classes[] = 0 === $key ? 'active' : ''; ?>