PluginProbe
Additional Terms Lite for WooCommerce / 1.7.3
Additional Terms Lite for WooCommerce v1.7.3
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.7.3, at src/Helper/Settings.php

55 lines 1023 B
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 * @since 1.6.0
6 *
7 * @package woo-additional-terms
8 */
9
10 namespace Woo_Additional_Terms\Helper;
11
12 /**
13 * Helpers for the plugin settings.
14 */
15 abstract class Settings {
16
17 /**
18 * Check if the current page is the settings page.
19 *
20 * @since 1.6.0
21 *
22 * @return bool
23 */
24 public static function is_page() {
25
26 // phpcs:disable WordPress.Security.NonceVerification.Recommended
27 return (
28 isset( $_GET['page'] )
29 && 'wc-settings' === $_GET['page']
30 && isset( $_GET['tab'] )
31 && woo_additional_terms()->get_slug() === $_GET['tab']
32 );
33 // phpcs:enable WordPress.Security.NonceVerification.Recommended
34 }
35
36 /**
37 * Get the plugin settings URI.
38 *
39 * @since 1.6.0
40 *
41 * @return string
42 */
43 public static function page_uri() {
44
45 // e.g, "http://example.com/wp-admin/admin.php?page=wc-settings&tab=woo-additional-terms".
46 return add_query_arg(
47 array(
48 'page' => 'wc-settings',
49 'tab' => woo_additional_terms()->get_slug(),
50 ),
51 admin_url( 'admin.php' )
52 );
53 }
54 }
55