wp_create_nonce( 'ayg_ajax_nonce' ), 'i18n' => array( 'invalid_api_key' => __( 'Invalid API Key', 'automatic-youtube-gallery' ), 'cleared' => __( 'Cleared', 'automatic-youtube-gallery' ) ) ) ); } /** * Add dashboard page link on the plugins menu. * * @since 1.0.0 * @param array $links An array of plugin action links. * @return string $links Array of filtered plugin action links. */ public function plugin_action_links( $links ) { $dashboard_link = sprintf( '%s', admin_url( 'admin.php?page=automatic-youtube-gallery' ), __( 'Build Gallery', 'automatic-youtube-gallery' ) ); array_unshift( $links, $dashboard_link ); return $links; } /** * Add "Dashboard" menu. * * @since 1.3.0 */ public function admin_menu() { add_menu_page( __( 'Automatic YouTube Gallery', 'automatic-youtube-gallery' ), __( 'YouTube Gallery', 'automatic-youtube-gallery' ), 'manage_options', 'automatic-youtube-gallery', array( $this, 'display_dashboard_content' ), 'dashicons-video-alt3', 10 ); add_submenu_page( 'automatic-youtube-gallery', __( 'Dashboard', 'automatic-youtube-gallery' ), __( 'Dashboard', 'automatic-youtube-gallery' ), 'manage_options', 'automatic-youtube-gallery', array( $this, 'display_dashboard_content' ) ); } /** * Display dashboard content. * * @since 1.3.0 */ public function display_dashboard_content() { $general_settings = get_option( 'ayg_general_settings' ); $tabs = array( 'dashboard' => __( 'Build Gallery', 'automatic-youtube-gallery' ) ); $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : 'dashboard'; require_once AYG_DIR . 'admin/templates/dashboard.php'; } /** * Prints admin screen notices. * * @since 2.0.0 */ public function admin_notices() { $general_settings = get_option( 'ayg_general_settings' ); if ( isset( $general_settings['development_mode'] ) && ! empty( $general_settings['development_mode'] ) ) { ?>

Automatic YouTube Gallery: You have development mode enabled. We do not cache API results in this mode. While this is ok when you are testing the plugin, we strongly recommend disabling this option when your site goes live.', 'automatic-youtube-gallery' ), esc_url( admin_url( 'admin.php?page=automatic-youtube-gallery-settings' ) ) ); ?>