get('Version'); $author_blog_name = $author_blog_theme->get('Name'); define('AUTHOR_BLOG_THEME_VERSION', $author_blog_version); define('AUTHOR_BLOG_THEME_NAME', $author_blog_name); if( ! function_exists( 'author_blog_getting_started_menu' ) ) : /** * Adding Getting Started Page in admin menu */ function author_blog_getting_started_menu(){ add_theme_page( __( '[ Author Blog ] Getting Started', 'author-blog' ), __( '[ Author Blog ] Getting Started', 'author-blog' ), 'manage_options', 'author-blog-getting-started', 'author_blog_getting_started_page', $position = 0 ); } endif; add_action( 'admin_menu', 'author_blog_getting_started_menu' ); if( ! function_exists( 'author_blog_getting_started_admin_scripts' ) ) : /** * Load Getting Started styles in the admin */ function author_blog_getting_started_admin_scripts( $hook ){ wp_enqueue_style( 'author-blog-focus', get_template_directory_uri() . '/inc/getting-started/css/focus.css', false, AUTHOR_BLOG_THEME_VERSION ); // Load styles only on our page if( 'appearance_page_author-blog-getting-started' != $hook ) return; wp_enqueue_style( 'author-blog-getting-started', get_template_directory_uri() . '/inc/getting-started/css/getting-started.css', false, AUTHOR_BLOG_THEME_VERSION ); wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); wp_enqueue_script( 'author-blog-getting-started', get_template_directory_uri() . '/inc/getting-started/js/getting-started.js', array( 'jquery' ), AUTHOR_BLOG_THEME_VERSION, true ); wp_enqueue_script( 'author-blog-recommended-plugin-install', get_template_directory_uri() . '/inc/getting-started/js/recommended-plugin-install.js', array( 'jquery' ), AUTHOR_BLOG_THEME_VERSION, true ); wp_localize_script( 'author-blog-recommended-plugin-install', 'author_blog_start_page', array( 'activating' => __( 'Activating ', 'author-blog' ) ) ); } endif; add_action( 'admin_enqueue_scripts', 'author_blog_getting_started_admin_scripts' ); if( ! function_exists( 'author_blog_call_plugin_api' ) ) : /** * Plugin API **/ function author_blog_call_plugin_api( $plugin ) { include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $call_api = plugins_api( 'plugin_information', array( 'slug' => $plugin, 'fields' => array( 'downloaded' => false, 'rating' => false, 'description' => false, 'short_description' => true, 'donate_link' => false, 'tags' => false, 'sections' => true, 'homepage' => true, 'added' => false, 'last_updated' => false, 'compatibility' => false, 'tested' => false, 'requires' => false, 'downloadlink' => false, 'icons' => true ) ) ); return $call_api; } endif; if( ! function_exists( 'author_blog_check_for_icon' ) ) : /** * Check For Icon **/ function author_blog_check_for_icon( $arr ) { if( ! empty( $arr['svg'] ) ){ $plugin_icon_url = $arr['svg']; }elseif( ! empty( $arr['2x'] ) ){ $plugin_icon_url = $arr['2x']; }elseif( ! empty( $arr['1x'] ) ){ $plugin_icon_url = $arr['1x']; }else{ $plugin_icon_url = $arr['default']; } return $plugin_icon_url; } endif; if( ! function_exists( 'author_blog_getting_started_page' ) ) : /** * Callback function for admin page. */ function author_blog_getting_started_page(){ ?>