PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 1.1.0
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v1.1.0
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / admin / admin.php

admin.php in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels 1.1.0, at admin/admin.php

136 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The admin-specific functionality of the plugin.
5 *
6 * @link https://plugins360.com
7 * @since 1.0.0
8 *
9 * @package Automatic_YouTube_Gallery
10 * @subpackage Automatic_YouTube_Gallery/admin
11 */
12
13 // Exit if accessed directly
14 if ( ! defined( 'WPINC' ) ) {
15 die;
16 }
17
18 /**
19 * AYG_Admin class.
20 *
21 * @since 1.0.0
22 */
23 class AYG_Admin {
24
25 /**
26 * Enqueue styles for the admin area.
27 *
28 * @since 1.0.0
29 */
30 public function enqueue_styles() {
31
32 wp_enqueue_style( 'wp-color-picker' );
33
34 wp_enqueue_style(
35 AYG_SLUG . '-admin',
36 AYG_URL . 'admin/assets/css/admin.css',
37 array(),
38 AYG_VERSION,
39 'all'
40 );
41
42 }
43
44 /**
45 * Enqueue scripts for the admin area.
46 *
47 * @since 1.0.0
48 */
49 public function enqueue_scripts() {
50
51 wp_enqueue_media();
52 wp_enqueue_script( 'wp-color-picker' );
53
54 wp_enqueue_script(
55 AYG_SLUG . '-admin',
56 AYG_URL . 'admin/assets/js/admin.js',
57 array( 'jquery' ),
58 AYG_VERSION,
59 false
60 );
61
62 wp_localize_script(
63 AYG_SLUG . '-admin',
64 'ayg_admin',
65 array(
66 'i18n' => array(
67 'cleared' => __( 'Cleared', 'automatic-youtube-gallery' )
68 )
69 )
70 );
71
72 }
73
74 /**
75 * Add settings page link on the plugins menu.
76 *
77 * @since 1.0.0
78 * @param array $links An array of plugin action links.
79 * @return string $links Array of filtered plugin action links.
80 */
81 public function plugin_action_links( $links ) {
82
83 $settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=automatic-youtube-gallery' ), __( 'Settings', 'automatic-youtube-gallery' ) );
84 array_unshift( $links, $settings_link );
85
86 return $links;
87
88 }
89
90 /**
91 * Display admin notice.
92 *
93 * @since 1.0.0
94 */
95 public function admin_notice() {
96
97 $screen = get_current_screen();
98
99 $post_type = $screen->post_type;
100 if ( 'post' == $post_type || 'page' == $post_type ) {
101 return;
102 }
103
104 if ( false == get_option( 'ayg_admin_notice_dismissed' ) ) : ?>
105 <div id="ayg-admin-notice" class="notice notice-info is-dismissible" data-security="<?php echo wp_create_nonce( 'ayg_admin_notice_nonce' ); ?>">
106 <p>
107 <span class="dashicons-before dashicons-video-alt3"></span> <strong><?php _e( 'Automatic YouTube Gallery', 'automatic-youtube-gallery' ); ?></strong>:
108 <a href="https://plugins360.com/automatic-youtube-gallery/documentation/" target="_blank"><?php _e( 'Getting Started', 'automatic-youtube-gallery' ); ?></a>
109 <span class="ayg-admin-notice-separator"> | </span>
110 <a href="<?php echo admin_url( 'admin.php?page=automatic-youtube-gallery-contact' ); ?>"><?php _e( 'Contact Us', 'automatic-youtube-gallery' ); ?></a>
111 <?php if ( ayg_fs()->is_not_paying() ) : ?>
112 <span class="ayg-admin-notice-separator"> | </span>
113 <a href="<?php echo ayg_fs()->get_upgrade_url(); ?>" class="ayg-admin-notice-link-premium"><?php _e( 'Upgrade Pro', 'automatic-youtube-gallery' ); ?></a>
114 <?php endif; ?>
115 </p>
116 </div>
117 <?php endif;
118
119 }
120
121 /**
122 * Dismiss admin notice.
123 *
124 * @since 1.0.0
125 */
126 public function ajax_callback_dismiss_admin_notice() {
127
128 check_ajax_referer( 'ayg_admin_notice_nonce', 'security' );
129
130 add_option( 'ayg_admin_notice_dismissed', 1 );
131 wp_die();
132
133 }
134
135 }
136