PluginProbe
Additional Terms Lite for WooCommerce / 1.6.1
Additional Terms Lite for WooCommerce v1.6.1
1.7.3 1.7.2.1 trunk 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.6.3 All 35 releases
woo-additional-terms / src / Helper / Settings.php

Settings.php in Additional Terms Lite for WooCommerce 1.6.1, at src/Helper/Settings.php

57 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Settings helpers.
4 *
5 * @author MyPreview (Github: @mahdiyazdani, @gooklani, @mypreview)
6 *
7 * @since 1.6.0
8 *
9 * @package woo-additional-terms
10 */
11
12 namespace Woo_Additional_Terms\Helper;
13
14 /**
15 * Helpers for the plugin settings.
16 */
17 abstract class Settings {
18
19 /**
20 * Check if the current page is the settings page.
21 *
22 * @since 1.6.0
23 *
24 * @return bool
25 */
26 public static function is_page() {
27
28 // phpcs:disable WordPress.Security.NonceVerification.Recommended
29 return (
30 isset( $_GET['page'] )
31 && 'wc-settings' === $_GET['page']
32 && isset( $_GET['tab'] )
33 && woo_additional_terms()->get_slug() === $_GET['tab']
34 );
35 // phpcs:enable WordPress.Security.NonceVerification.Recommended
36 }
37
38 /**
39 * Get the plugin settings URI.
40 *
41 * @since 1.6.0
42 *
43 * @return string
44 */
45 public static function page_uri() {
46
47 // e.g, "http://example.com/wp-admin/admin.php?page=wc-settings&tab=woo-additional-terms".
48 return add_query_arg(
49 array(
50 'page' => 'wc-settings',
51 'tab' => woo_additional_terms()->get_slug(),
52 ),
53 admin_url( 'admin.php' )
54 );
55 }
56 }
57