diff --git a/includes/admin/class-ur-admin-menus.php b/includes/admin/class-ur-admin-menus.php index 0ff563626..37b8b3da9 100644 --- a/includes/admin/class-ur-admin-menus.php +++ b/includes/admin/class-ur-admin-menus.php @@ -78,57 +78,17 @@ public function add_upgradable_other_fields() { 'slug' => 'learndash', 'name' => __( 'User Registration LearnDash', 'user-registration' ), ), + array( + 'id' => 'user_registration_stripe_gateway', + 'label' => 'Stripe Gateway', + 'icon' => 'ur-icon ur-icon-credit-card', + 'field_class' => 'UR_Form_Field_Stripe_Gateway', + 'plan' => 'ThemeGrill Agency Plan or Professional Plan or Plus Plan', + 'slug' => array( 'stripe' ), + 'name' => array( __( 'User Registration Stripe', 'user-registration' ) ), + ), ); - if ( ! is_plugin_active( 'user-registration-payments/user-registration-payments.php' ) && ! is_plugin_active( 'user-registration-stripe/user-registration-stripe.php' ) ) { - $fields = array_merge( - $fields, - array( - array( - 'id' => 'user_registration_stripe_gateway', - 'label' => 'Stripe Gateway', - 'icon' => 'ur-icon ur-icon-credit-card', - 'field_class' => 'UR_Form_Field_Stripe_Gateway', - 'plan' => 'ThemeGrill Agency Plan or Professional Plan or Plus Plan', - 'slug' => array( 'payments', 'stripe' ), - 'name' => array( __( 'User Registration Payments', 'user-registration' ), __( 'User Registration Stripe', 'user-registration' ) ), - ), - ) - ); - } else { - if ( ! is_plugin_active( 'user-registration-payments/user-registration-payments.php' ) && is_plugin_active( 'user-registration-stripe/user-registration-stripe.php' ) ) { - $fields = array_merge( - $fields, - array( - array( - 'id' => 'user_registration_stripe_gateway', - 'label' => 'Stripe Gateway', - 'icon' => 'ur-icon ur-icon-credit-card', - 'field_class' => 'UR_Form_Field_Stripe_Gateway', - 'plan' => 'ThemeGrill Agency Plan or Professional Plan or Plus Plan', - 'slug' => 'payments', - 'name' => __( 'User Registration Payments', 'user-registration' ), - ), - ) - ); - } elseif ( is_plugin_active( 'user-registration-payments/user-registration-payments.php' ) && ! is_plugin_active( 'user-registration-stripe/user-registration-stripe.php' ) ) { - $fields = array_merge( - $fields, - array( - array( - 'id' => 'user_registration_stripe_gateway', - 'label' => 'Stripe Gateway', - 'icon' => 'ur-icon ur-icon-credit-card', - 'field_class' => 'UR_Form_Field_Stripe_Gateway', - 'plan' => 'ThemeGrill Agency Plan or Professional Plan or Plus Plan', - 'slug' => 'stripe', - 'name' => __( 'User Registration Stripe', 'user-registration' ), - ), - ) - ); - } - } - foreach ( $fields as $field ) { if ( 'user_registration_learndash' === $field['id'] ) { if ( ! defined( 'LEARNDASH_VERSION' ) ) { @@ -348,8 +308,8 @@ public function add_upgradable_extra_fields() { 'section_title' => 'Payment Fields', 'fields_parent_class' => 'User_Registration_Payments_Admin', 'plan' => 'ThemeGrill Agency Plan or Professional Plan or Plus Plan', - 'slug' => 'payments', - 'name' => __( 'User Registration Payments', 'user-registration' ), + 'slug' => array( 'payments', 'stripe' ), + 'name' => array( __( 'User Registration Payments', 'user-registration' ), __( 'User Registration Stripe', 'user-registration' ) ), 'fields' => array( array( 'id' => 'user_registration_single_item', @@ -495,7 +455,6 @@ public function registration_page_init() { ) ); } - } /** @@ -603,7 +562,7 @@ public function set_screen_option( $status, $option, $value ) { public function registration_page() { global $registration_table_list; if ( isset( $_GET['tab'] ) && 'login-forms' === $_GET['tab'] ) { //phpcs:ignore WordPress.Security.NonceVerification - include_once dirname( __FILE__ ) . '/views/html-login-page-forms.php'; + include_once __DIR__ . '/views/html-login-page-forms.php'; } else { $registration_table_list->display_page(); } @@ -665,13 +624,13 @@ public function add_registration_page() { ); if ( isset( $_GET['edit-registration'] ) ) { // Forms view. - include_once dirname( __FILE__ ) . '/views/html-admin-page-forms.php'; + include_once __DIR__ . '/views/html-admin-page-forms.php'; } else { UR_Admin_Form_Templates::load_template_view(); } // Forms view. - include_once dirname( __FILE__ ) . '/views/html-admin-page-forms.php'; + include_once __DIR__ . '/views/html-admin-page-forms.php'; } /** @@ -757,7 +716,7 @@ public function nav_menu_links() { name="menu-item[][menu-item-classes]"/> @@ -907,7 +866,7 @@ private function get_edit_form_field( $form_data ) { foreach ( $rows as $grid_lists ) { - $grid_id ++; + ++$grid_id; echo '
'; @@ -1017,7 +976,6 @@ public function ur_get_list( $field ) { if ( null !== $class_name ) { echo wp_kses_post( $class_name::get_instance()->get_registered_admin_fields() ); } - } }