PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.2.8
Post Grid Gutenberg Blocks – PostX v2.2.8
5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 2.1.2 All 237 releases
ultimate-post / classes / Options.php

Options.php in Post Grid Gutenberg Blocks – PostX 2.2.8, at classes/Options.php

117 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Options Action.
4 *
5 * @package ULTP\Notice
6 * @since v.1.0.0
7 */
8 namespace ULTP;
9
10 defined('ABSPATH') || exit;
11
12 /**
13 * Options class.
14 */
15 class Options{
16
17 /**
18 * Setup class.
19 *
20 * @since v.1.0.0
21 */
22 public function __construct() {
23 add_action( 'admin_menu', array( $this, 'menu_page_callback' ) );
24 add_action( 'in_admin_header', array($this, 'remove_all_notices') );
25 add_filter( 'plugin_row_meta', array( $this, 'plugin_settings_meta' ), 10, 2 );
26 add_filter( 'plugin_action_links_'.ULTP_BASE, array( $this, 'plugin_action_links_callback' ) );
27 }
28
29
30 /**
31 * Plugin Page Menu Add
32 *
33 * @since v.1.0.0
34 * @return ARRAY
35 */
36 public function plugin_settings_meta( $links, $file ) {
37 if ( strpos( $file, 'ultimate-post.php' ) !== false ) {
38 $new_links = array(
39 'ultp_docs' => '<a href="https://docs.wpxpo.com/" target="_blank">'.__('Docs', 'ultimate-post').'</a>',
40 'ultp_tutorial' => '<a href="https://www.youtube.com/watch?v=JZxIflYKOuM&list=PLPidnGLSR4qcAwVwIjMo1OVaqXqjUp_s4" target="_blank">'.__('Tutorials', 'ultimate-post').'</a>',
41 'ultp_support' => '<a href="'.ultimate_post()->get_premium_link( 'https://www.wpxpo.com/contact/' ).'" target="_blank">'.__('Support', 'ultimate-post').'</a>'
42 );
43 $links = array_merge( $links, $new_links );
44 }
45 return $links;
46 }
47
48
49 /**
50 * Settings Pro Update Link
51 *
52 * @since v.1.0.0
53 * @return ARRAY
54 */
55 public function plugin_action_links_callback( $links ) {
56 $upgrade_link = array();
57 $setting_link = array();
58 if(!defined('ULTP_PRO_VER')){
59 $upgrade_link = array(
60 'ultp_pro' => '<a href="'.ultimate_post()->get_premium_link().'" target="_blank"><span style="color: #e83838; font-weight: bold;">'.__('Go Pro', 'ultimate-post').'</span></a>'
61 );
62 }
63 $setting_link['ultp_settings'] = '<a href="'. menu_page_url('ultp-option-settings', false) .'">'. __('Settings', 'wp-megamenu') .'</a>';
64 return array_merge( $setting_link, $links, $upgrade_link);
65 }
66
67
68 /**
69 * Admin Menu Option Page
70 *
71 * @since v.1.0.0
72 * @return NULL
73 */
74 public static function menu_page_callback() {
75 add_menu_page(
76 esc_html__( 'Post Blocks', 'ultimate-post' ),
77 esc_html__( 'Post Blocks', 'ultimate-post' ),
78 'manage_options',
79 'ultp-settings',
80 '',
81 ULTP_URL.'assets/img/menu-panel.svg'
82 );
83
84 require_once ULTP_PATH . 'classes/options/Overview.php';
85 require_once ULTP_PATH . 'classes/options/Features.php';
86 require_once ULTP_PATH . 'classes/options/Addons.php';
87 require_once ULTP_PATH . 'classes/options/Settings.php';
88 require_once ULTP_PATH . 'classes/options/Contact.php';
89 new \ULTP\Options_Overview();
90 new \ULTP\Options_Features();
91 new \ULTP\Options_Addons();
92 new \ULTP\Options_Settings();
93 new \ULTP\Options_Contact();
94
95 if( !function_exists('ultimate_post_pro') ){
96 global $submenu;
97 $upgrade_link = ultimate_post()->get_premium_link( 'https://www.wpxpo.com/postx/?ultp=plugins' );
98 $submenu['ultp-settings'][] = array( '<span class="ultp-dashboard-upgrade"><span class="dashicons dashicons-update"></span> Upgrade</span>', 'manage_options', $upgrade_link );
99 }
100 }
101
102
103 /**
104 * Remove All Notification From Menu Page
105 *
106 * @since v.1.0.0
107 * @return NULL
108 */
109 public static function remove_all_notices() {
110 if ( isset( $_GET['page'] ) && ( $_GET['page'] === 'ultp-settings' || $_GET['page'] === 'ultp-features' || $_GET['page'] === 'ultp-addons' || $_GET['page'] === 'ultp-option-settings' || $_GET['page'] === 'ultp-contact' || $_GET['page'] === 'ultp-license' ) ) {
111 remove_all_actions( 'admin_notices' );
112 remove_all_actions( 'all_admin_notices' );
113 }
114 }
115 }
116
117