Plugin Directory

Changeset 3370056


Ignore:
Timestamp:
09/30/2025 01:33:57 AM (6 months ago)
Author:
wp.insider
Message:

added settings to allow partial protection message customization

Location:
simple-membership-custom-messages/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • simple-membership-custom-messages/trunk/classes/class.swpm-custom-message-settings.php

    r3215941 r3370056  
    2828        register_setting('swpm-custom-message-tab-1', 'swpm-custom-message-settings', array(&$this, 'sanitize_tab_1'));
    2929
    30         add_settings_section('swpm-documentation', __('Plugin Documentation','simple-membership'), array(&$this, 'swpm_documentation_callback'), 'swpm-custom-message-settings');
     30        add_settings_section('swpm-documentation', __('Plugin fsdafsaDocumentation','simple-membership'), array(&$this, 'swpm_documentation_callback'), 'swpm-custom-message-settings');
    3131
    3232        add_settings_section('pages-settings', __('Custom Message Settings','simple-membership'), array(&$this, 'swpm_cm_general_settings_callback'), 'swpm-custom-message-settings');
     
    108108            ));
    109109
     110        /**
     111         * Partial Protection Addon related settings
     112         */
     113        add_settings_section('partial-protection-settings', __('Partial Protection Addon Related','simple-membership'), array(&$this, 'swpm_partial_protection_settings_callback'), 'swpm-custom-message-settings');
     114
     115        add_settings_field(
     116            'swpm_pp_output_when_not_logged_in',
     117            __('Partially Protected - Not Logged In', 'simple-membership'),
     118            array(&$this, 'textfield_long_callback'),
     119            'swpm-custom-message-settings',
     120            'partial-protection-settings',
     121            array(
     122                'item' => 'swpm_pp_output_when_not_logged_in',
     123                'message' => "Shown when a visitor isn't logged in."
     124            ));
     125
     126        add_settings_field(
     127            'swpm_pp_output_when_no_access',
     128            __('Partially Protected - Member No Access', 'simple-membership'),
     129            array(&$this, 'textfield_long_callback'),
     130            'swpm-custom-message-settings',
     131            'partial-protection-settings',
     132            array(
     133                'item' => 'swpm_pp_output_when_no_access',
     134                'message' => "Shown when a logged-in member doesn't have access at all."
     135            ));
     136
     137        add_settings_field(
     138            'swpm_pp_output_when_membership_level_restricted',
     139            __('Partially Protected - Membership Level Restricted', 'simple-membership'),
     140            array(&$this, 'textfield_long_callback'),
     141            'swpm-custom-message-settings',
     142            'partial-protection-settings',
     143            array(
     144                'item' => 'swpm_pp_output_when_membership_level_restricted',
     145                'message' => "Shown when their current level doesn't allow access."
     146            ));
     147
     148        add_settings_field(
     149            'swpm_pp_output_when_account_status_restricted',
     150            __('Partially Protected - Account Status Restricted', 'simple-membership'),
     151            array(&$this, 'textfield_long_callback'),
     152            'swpm-custom-message-settings',
     153            'partial-protection-settings',
     154            array(
     155                'item' => 'swpm_pp_output_when_account_status_restricted',
     156                'message' => "Shown when account status, e.g. inactive/expired, blocks access"
     157            ));
     158
     159
    110160        if ( defined( 'SWPM_FPP_PROTECTION_VER' ) ) {
    111161            //Full Page Protection addon is enabled. Let's check if its version is >=1.2
     
    185235    public function swpm_cm_general_settings_callback() {
    186236        echo '<p>Core plugin message will only be overwritten if you specify a value in any of the following fields.<p>';
     237    }
     238
     239    public function swpm_partial_protection_settings_callback() {
     240        echo '<p>Partial Protection Addon message will only be overwritten if you specify a value in any of the following fields.<p>';
    187241    }
    188242
     
    211265        $output['swpm_mini_login_output_when_logged_in'] = isset($input['swpm_mini_login_output_when_logged_in']) ? ($input['swpm_mini_login_output_when_logged_in']) : '';
    212266        $output['swpm_mini_login_output_when_not_logged_in'] = isset($input['swpm_mini_login_output_when_not_logged_in']) ? ($input['swpm_mini_login_output_when_not_logged_in']) : '';
     267   
     268        /**
     269         * Partial Protection Addon related settings
     270         */
     271        $output['swpm_pp_output_when_not_logged_in'] = isset($input['swpm_pp_output_when_not_logged_in']) ? ($input['swpm_pp_output_when_not_logged_in']) : '';
     272        $output['swpm_pp_output_when_no_access'] = isset($input['swpm_pp_output_when_no_access']) ? ($input['swpm_pp_output_when_no_access']) : '';
     273        $output['swpm_pp_output_when_membership_level_restricted'] = isset($input['swpm_pp_output_when_membership_level_restricted']) ? ($input['swpm_pp_output_when_membership_level_restricted']) : '';
     274        $output['swpm_pp_output_when_account_status_restricted'] = isset($input['swpm_pp_output_when_account_status_restricted']) ? ($input['swpm_pp_output_when_account_status_restricted']) : '';
    213275
    214276        return $output;
  • simple-membership-custom-messages/trunk/classes/class.swpm-custom-message.php

    r3125689 r3370056  
    3636        add_filter('swpm_mini_login_output_when_not_logged_in',array(&$this,'swpm_mini_login_output_when_not_logged_in'));
    3737
     38        // Partial Protection Addon
     39        add_filter('swpm_pp_output_when_not_logged_in', array(&$this, 'swpm_pp_output_when_not_logged_in'));
     40        add_filter('swpm_pp_output_when_no_access', array(&$this, 'swpm_pp_output_when_no_access'));
     41        add_filter('swpm_pp_output_when_membership_level_restricted', array(&$this, 'swpm_pp_output_when_membership_level_restricted'));
     42        add_filter('swpm_pp_output_when_account_status_restricted', array(&$this, 'swpm_pp_output_when_account_status_restricted'));
    3843    }
    3944
     
    117122        return $this->dispatch_message('swpm_mini_login_output_when_not_logged_in', $output);
    118123    }
     124
     125    public function swpm_pp_output_when_not_logged_in($output) {
     126        return $this->dispatch_message('swpm_pp_output_when_not_logged_in', $output);
     127    }
     128
     129    public function swpm_pp_output_when_no_access($output) {
     130        return $this->dispatch_message('swpm_pp_output_when_no_access', $output);
     131    }
     132
     133    public function swpm_pp_output_when_membership_level_restricted($output) {
     134        return $this->dispatch_message('swpm_pp_output_when_membership_level_restricted', $output);
     135    }
     136
     137    public function swpm_pp_output_when_account_status_restricted($output) {
     138        return $this->dispatch_message('swpm_pp_output_when_account_status_restricted', $output);
     139    }
    119140
    120141    private function dispatch_message($key, $default) {
  • simple-membership-custom-messages/trunk/readme.txt

    r3271707 r3370056  
    33Donate link: https://simple-membership-plugin.com/
    44Tags: users, membership, custom, message, protection-message,
    5 Requires at least: 5.0
     5Requires at least: 6.0
    66Tested up to: 6.8
    7 Stable tag: 2.5
     7Stable tag: 2.6
    88License: GPLv2 or later
    99
     
    3434
    3535== Changelog ==
     36
     37= 2.6 =
     38- Added new settings to allow customization of some of the partial protection addon's output.
    3639
    3740= 2.5 =
  • simple-membership-custom-messages/trunk/swpm-custom-message.php

    r3215941 r3370056  
    66Author: wp.insider
    77Author URI: https://simple-membership-plugin.com/
    8 Version: 2.5
     8Version: 2.6
    99*/
    1010
    1111//Slug - swpm_cm_
    1212
    13 define('SWPM_CUSTOM_MSG_VERSION', '2.5' );
     13define('SWPM_CUSTOM_MSG_VERSION', '2.6' );
    1414define('SWPM_CUSTOM_MSG_PATH', dirname(__FILE__) . '/');
    1515define('SWPM_CUSTOM_MSG_URL', plugins_url('',__FILE__));
Note: See TracChangeset for help on using the changeset viewer.