diff --git a/assets/css/menu.css b/assets/css/menu.css
index e88ec355..ad852836 100644
--- a/assets/css/menu.css
+++ b/assets/css/menu.css
@@ -155,6 +155,9 @@
.sp-icon-user-scores:before {
content: "\f101";
}
+.sp-icon-wordpay:before {
+ content: "\f526";
+}
/* Performance Icons */
.sp-icon-card:before {
diff --git a/assets/fonts/sportspress.eot b/assets/fonts/sportspress.eot
index 8477a378..90c32b3c 100755
Binary files a/assets/fonts/sportspress.eot and b/assets/fonts/sportspress.eot differ
diff --git a/assets/fonts/sportspress.svg b/assets/fonts/sportspress.svg
index 2284645d..45b6409d 100755
--- a/assets/fonts/sportspress.svg
+++ b/assets/fonts/sportspress.svg
@@ -60,4 +60,5 @@
+
\ No newline at end of file
diff --git a/assets/fonts/sportspress.ttf b/assets/fonts/sportspress.ttf
index 244af655..77d95c6a 100755
Binary files a/assets/fonts/sportspress.ttf and b/assets/fonts/sportspress.ttf differ
diff --git a/assets/fonts/sportspress.woff b/assets/fonts/sportspress.woff
index 6a2213e1..c60adaad 100755
Binary files a/assets/fonts/sportspress.woff and b/assets/fonts/sportspress.woff differ
diff --git a/assets/fonts/sportspress.woff2 b/assets/fonts/sportspress.woff2
index dc94ae0b..8e1deffc 100755
Binary files a/assets/fonts/sportspress.woff2 and b/assets/fonts/sportspress.woff2 differ
diff --git a/assets/images/modules/wordpay.png b/assets/images/modules/wordpay.png
new file mode 100644
index 00000000..db24c720
Binary files /dev/null and b/assets/images/modules/wordpay.png differ
diff --git a/includes/admin/settings/class-sp-settings-modules.php b/includes/admin/settings/class-sp-settings-modules.php
index 2f60eb9b..035442f4 100644
--- a/includes/admin/settings/class-sp-settings-modules.php
+++ b/includes/admin/settings/class-sp-settings-modules.php
@@ -59,7 +59,7 @@ class SP_Settings_Modules extends SP_Settings_Page {
-
+
|
@@ -74,6 +74,25 @@ class SP_Settings_Modules extends SP_Settings_Page {
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
diff --git a/includes/class-sp-modules.php b/includes/class-sp-modules.php
index 83073784..0bbf07c9 100644
--- a/includes/class-sp-modules.php
+++ b/includes/class-sp-modules.php
@@ -152,6 +152,14 @@ class SP_Modules {
'link' => 'https://www.themeboy.com/sportspress-extensions/sponsors/',
'desc' => __( 'Attract sponsors by offering them advertising space on your website.', 'sportspress' ),
),
+ 'wordpay' => array(
+ 'label' => __( 'WordPay', 'sportspress' ),
+ 'class' => 'WordPay',
+ 'icon' => 'sp-icon-wordpay',
+ 'link' => 'https://wordpay.org/',
+ 'desc' => __( 'Start collecting club membership payments with WordPay.', 'sportspress' ),
+ 'tip' => __( 'Get WordPay', 'sportspress' ),
+ ),
),
));
diff --git a/modules/sportspress-user-registration.php b/modules/sportspress-user-registration.php
index 1bfa9312..d1b80ea7 100644
--- a/modules/sportspress-user-registration.php
+++ b/modules/sportspress-user-registration.php
@@ -64,6 +64,22 @@ class SportsPress_User_Registration {
'checkboxgroup' => 'start',
),
+ array(
+ 'desc' => __( 'Add a team name field to signup form', 'sportspress' ),
+ 'id' => 'sportspress_registration_team_input',
+ 'default' => 'no',
+ 'type' => 'checkbox',
+ 'checkboxgroup' => '',
+ ),
+
+ array(
+ 'desc' => __( 'Add a team selector to signup form', 'sportspress' ),
+ 'id' => 'sportspress_registration_team_select',
+ 'default' => 'no',
+ 'type' => 'checkbox',
+ 'checkboxgroup' => '',
+ ),
+
array(
'desc' => __( 'Create player profiles for new users', 'sportspress' ),
'id' => 'sportspress_registration_add_player',
@@ -85,16 +101,35 @@ class SportsPress_User_Registration {
$last_name = ( ! empty( $_POST['last_name'] ) ) ? trim( $_POST['last_name'] ) : '';
?>
-
+
-
+
+
+
+ define_constants();
+
+ // Shortcode
+ add_action( 'init', array( $this, 'add_shortcodes' ) );
+ add_action( 'wpay_register_form_after_fields', array( $this, 'form_field' ) );
+
+ // Editor
+ add_filter( 'wordpay_shortcodes', array( $this, 'editor_shortcodes' ) );
+ add_filter( 'wordpay_tinymce_strings', array( $this, 'editor_strings' ) );
+
+ // Widgets
+ add_action( 'wordpay_after_widget_register_form', array( $this, 'widget_form' ), 10, 2 );
+ add_filter( 'wordpay_widget_register_update', array( $this, 'widget_update' ), 10, 2 );
+ add_filter( 'wordpay_widget_register_shortcode', array( $this, 'widget_shortcode' ), 10, 2 );
+ }
+
+ /**
+ * Define constants.
+ */
+ private function define_constants() {
+ if ( !defined( 'SP_WORDPAY_VERSION' ) )
+ define( 'SP_WORDPAY_VERSION', '2.3' );
+
+ if ( !defined( 'SP_WORDPAY_URL' ) )
+ define( 'SP_WORDPAY_URL', plugin_dir_url( __FILE__ ) );
+
+ if ( !defined( 'SP_WORDPAY_DIR' ) )
+ define( 'SP_WORDPAY_DIR', plugin_dir_path( __FILE__ ) );
+ }
+ /**
+ * Add team and player registration shortcodes.
+ */
+ public static function add_shortcodes() {
+ add_shortcode( 'wpay-register-team', array( $this, 'register_team' ) );
+ add_shortcode( 'wpay-register-player', array( $this, 'register_player' ) );
+ }
+
+ /**
+ * Team registration shortcode.
+ */
+ public static function register_team( $atts = array() ) {
+ $args = array(
+ 'post_type' => 'wpay-subscription',
+ 'post_status' => 'active',
+ 'posts_per_page' => 500,
+ 'meta_query' => array(
+ array(
+ 'key' => 'wpay_subscription_plan_user_role',
+ 'value' => 'sp_team_manager',
+ ),
+ ),
+ 'fields' => 'ids',
+ );
+
+ $plans = get_posts( $args );
+
+ if ( empty( $plans ) ) {
+ _e( 'There are no plans associated with the Team Manager role.', 'sportspress' );
+ return;
+ }
+
+ return self::register_form( $atts, 'team', $plans );
+ }
+
+ /**
+ * Player registration shortcode.
+ */
+ public static function register_player( $atts = array() ) {
+ $args = array(
+ 'post_type' => 'wpay-subscription',
+ 'post_status' => 'active',
+ 'posts_per_page' => 500,
+ 'meta_query' => array(
+ array(
+ 'key' => 'wpay_subscription_plan_user_role',
+ 'value' => 'sp_player',
+ ),
+ ),
+ 'fields' => 'ids',
+ );
+
+ $plans = get_posts( $args );
+
+ if ( empty( $plans ) ) {
+ _e( 'There are no plans associated with the Player role.', 'sportspress' );
+ return;
+ }
+
+ return self::register_form( $atts, 'player', $plans );
+ }
+
+ /**
+ * Registration form template.
+ */
+ public static function register_form( $atts = array(), $context = '', $plans = array() ) {
+
+ $atts = shortcode_atts( array(
+ 'plans_position' => 'bottom',
+ 'selected' => '',
+ ), $atts );
+
+ $atts['subscription_plans'] = implode( ',', $plans );
+
+ $atts['context'] = $context;
+
+ $shortcode = '[wpay-register';
+
+ foreach ( $atts as $key => $value ) {
+ $shortcode .= ' ' . $key . '="' . esc_attr( $value ) . '"';
+ }
+
+ $shortcode .= ']';
+
+ return do_shortcode( $shortcode );
+ }
+
+ /**
+ * Add field to registration form.
+ */
+ public static function form_field( $atts = array() ) {
+ if ( 'team' == $atts['context'] ) {
+ ?>
+
+
+
+
+
+
+
+ 'sp_team',
+ 'name' => 'sp_team',
+ 'values' => 'ID',
+ 'show_option_none' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Team', 'sportspress' ) ),
+ 'class' => 'widefat',
+ );
+ sp_dropdown_pages( $args );
+ ?>
+
+ __( 'Members', 'sportspress' ),
+ 'team' => __( 'Teams', 'sportspress' ),
+ 'player' => __( 'Players', 'sportspress' ),
+ );
+ ?>
+
+
+
+
+