PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 1.3.0
Subscriptions for WooCommerce with Stripe Recurring Payments v1.3.0
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / includes / Admin / Settings.php

Settings.php in Subscriptions for WooCommerce with Stripe Recurring Payments 1.3.0, at includes/Admin/Settings.php

51 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SpringDevs\Subscription\Admin;
4
5 /**
6 * Class Settings
7 *
8 * @package SpringDevs\Subscription\Admin
9 */
10 class Settings {
11
12 /**
13 * Initialize the class.
14 */
15 public function __construct() {
16 add_action( 'admin_menu', array( $this, 'admin_menu' ) );
17 add_action( 'admin_init', array( $this, 'register_settings' ) );
18 }
19
20 /**
21 * Register submenu on `Subscriptions` menu.
22 *
23 * @return void
24 */
25 public function admin_menu() {
26 $post_type_link = 'edit.php?post_type=subscrpt_order';
27 add_submenu_page( $post_type_link, 'Subscription Settings', 'Settings', 'manage_options', 'subscrpt_settings', array( $this, 'settings_content' ) );
28 }
29
30 /**
31 * Register settings options.
32 **/
33 public function register_settings() {
34 register_setting( 'subscrpt_settings', 'subscrpt_renewal_process' );
35 register_setting( 'subscrpt_settings', 'subscrpt_manual_renew_cart_notice' );
36 register_setting( 'subscrpt_settings', 'subscrpt_active_role' );
37 register_setting( 'subscrpt_settings', 'subscrpt_unactive_role' );
38 register_setting( 'subscrpt_settings', 'subscrpt_stripe_auto_renew' );
39 register_setting( 'subscrpt_settings', 'subscrpt_auto_renewal_toggle' );
40
41 do_action( 'subscrpt_register_settings', 'subscrpt_settings' );
42 }
43
44 /**
45 * Settings HTML.
46 */
47 public function settings_content() {
48 include 'views/settings.php';
49 }
50 }
51