| 1 |
<?php |
| 2 |
/** |
| 3 |
* Callback functions for outputting help tabs in the admin. |
| 4 |
* |
| 5 |
* @package Members |
| 6 |
* @subpackage Admin |
| 7 |
* @author The MemberPress Team |
| 8 |
* @copyright Copyright (c) 2009 - 2018, The MemberPress Team |
| 9 |
* @link https://members-plugin.com/ |
| 10 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
| 11 |
*/ |
| 12 |
if (!defined('ABSPATH')) { |
| 13 |
die('You are not allowed to call this page directly.'); |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Help sidebar for all of the help tabs. |
| 18 |
* |
| 19 |
* @since 1.0.0 |
| 20 |
* @access public |
| 21 |
* @return string |
| 22 |
*/ |
| 23 |
function members_get_help_sidebar_text() { |
| 24 |
|
| 25 |
// Get docs and help links. |
| 26 |
$docs_link = sprintf( '<li><a href="https://members-plugin.com/docs/">%s</a></li>', esc_html__( 'Documentation', 'members' ) ); |
| 27 |
$help_link = sprintf( '<li><a href="https://wordpress.org/support/plugin/members/">%s</a></li>', esc_html__( 'Support Forums', 'members' ) ); |
| 28 |
|
| 29 |
// Return the text. |
| 30 |
return sprintf( |
| 31 |
'<p><strong>%s</strong></p><ul>%s%s</ul>', |
| 32 |
esc_html__( 'For more information:', 'members' ), |
| 33 |
$docs_link, |
| 34 |
$help_link |
| 35 |
); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Edit role overview help tab args. |
| 40 |
* |
| 41 |
* @since 1.0.0 |
| 42 |
* @access public |
| 43 |
* @return array |
| 44 |
*/ |
| 45 |
function members_get_edit_role_help_overview_args() { |
| 46 |
|
| 47 |
return array( |
| 48 |
'id' => 'overview', |
| 49 |
'title' => esc_html__( 'Overview', 'members' ), |
| 50 |
'callback' => 'members_edit_role_help_overview_cb' |
| 51 |
); |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Edit role name help tab args. |
| 56 |
* |
| 57 |
* @since 1.0.0 |
| 58 |
* @access public |
| 59 |
* @return array |
| 60 |
*/ |
| 61 |
function members_get_edit_role_help_role_name_args() { |
| 62 |
|
| 63 |
return array( |
| 64 |
'id' => 'role-name', |
| 65 |
'title' => esc_html__( 'Role Name', 'members' ), |
| 66 |
'callback' => 'members_edit_role_help_role_name_cb' |
| 67 |
); |
| 68 |
} |
| 69 |
|
| 70 |
/** |
| 71 |
* Edit role edit caps help tab args. |
| 72 |
* |
| 73 |
* @since 1.0.0 |
| 74 |
* @access public |
| 75 |
* @return array |
| 76 |
*/ |
| 77 |
function members_get_edit_role_help_edit_caps_args() { |
| 78 |
|
| 79 |
return array( |
| 80 |
'id' => 'edit-capabilities', |
| 81 |
'title' => esc_html__( 'Edit Capabilities', 'members' ), |
| 82 |
'callback' => 'members_edit_role_help_edit_caps_cb' |
| 83 |
); |
| 84 |
} |
| 85 |
|
| 86 |
/** |
| 87 |
* Edit role custom cap help tab args. |
| 88 |
* |
| 89 |
* @since 1.0.0 |
| 90 |
* @access public |
| 91 |
* @return array |
| 92 |
*/ |
| 93 |
function members_get_edit_role_help_custom_cap_args() { |
| 94 |
|
| 95 |
return array( |
| 96 |
'id' => 'custom-capability', |
| 97 |
'title' => esc_html__( 'Custom Capability', 'members' ), |
| 98 |
'callback' => 'members_edit_role_help_custom_cap_cb' |
| 99 |
); |
| 100 |
} |
| 101 |
|
| 102 |
/** |
| 103 |
* Edit role overview help tab callback function. |
| 104 |
* |
| 105 |
* @since 1.0.0 |
| 106 |
* @access public |
| 107 |
* @return void |
| 108 |
*/ |
| 109 |
function members_edit_role_help_overview_cb() { ?> |
| 110 |
|
| 111 |
<p> |
| 112 |
<?php esc_html_e( 'This screen allows you to edit an individual role and its capabilities.', 'members' ); ?> |
| 113 |
<p> |
| 114 |
|
| 115 |
<p> |
| 116 |
<?php printf( |
| 117 |
esc_html__( 'Visit the %s page in the WordPress Codex to see a complete list of roles, capabilities, and their definitions.', 'members' ), |
| 118 |
'<a href="https://codex.wordpress.org/Roles_and_Capabilities">' . esc_html__( 'Roles and Capabilities', 'members' ) . '</a>' |
| 119 |
); ?> |
| 120 |
</p> |
| 121 |
<?php } |
| 122 |
|
| 123 |
/** |
| 124 |
* Edit role name help tab callback function. |
| 125 |
* |
| 126 |
* @since 1.0.0 |
| 127 |
* @access public |
| 128 |
* @return void |
| 129 |
*/ |
| 130 |
function members_edit_role_help_role_name_cb() { ?> |
| 131 |
|
| 132 |
<p> |
| 133 |
<?php esc_html_e( 'The role name field allows you to enter a human-readable name for your role.', 'members' ); ?> |
| 134 |
</p> |
| 135 |
|
| 136 |
<p> |
| 137 |
<?php esc_html_e( 'The machine-readable version of the role appears below the name field, which you can edit. This can only have lowercase letters, numbers, or underscores.', 'members' ); ?> |
| 138 |
</p> |
| 139 |
<?php } |
| 140 |
|
| 141 |
/** |
| 142 |
* Edit role edit caps help tab callback function. |
| 143 |
* |
| 144 |
* @since 1.0.0 |
| 145 |
* @access public |
| 146 |
* @return void |
| 147 |
*/ |
| 148 |
function members_edit_role_help_edit_caps_cb() { ?> |
| 149 |
|
| 150 |
<p> |
| 151 |
<?php esc_html_e( 'The capabilities edit box is made up of tabs that separate capabilities into groups. You may take the following actions for each capability:', 'members' ); ?> |
| 152 |
</p> |
| 153 |
|
| 154 |
<ul> |
| 155 |
<li><?php _e( '<strong>Grant</strong> allows you to grant the role a capability.', 'members' ); ?></li> |
| 156 |
<li><?php _e( '<strong>Deny</strong> allows you to explicitly deny the role a capability.', 'members' ); ?></li> |
| 157 |
<li><?php esc_html_e( 'You may also opt to neither grant nor deny the role a capability.', 'members' ); ?></li> |
| 158 |
</ul> |
| 159 |
<?php } |
| 160 |
|
| 161 |
/** |
| 162 |
* Edit role custom cap help tab callback function. |
| 163 |
* |
| 164 |
* @since 1.0.0 |
| 165 |
* @access public |
| 166 |
* @return void |
| 167 |
*/ |
| 168 |
function members_edit_role_help_custom_cap_cb() { ?> |
| 169 |
|
| 170 |
<p> |
| 171 |
<?php esc_html_e( 'The custom capability box allows you to create a custom capability for the role. After hitting the Add New button, it will add the capability to the Custom tab in the Edit Capabilities box.', 'members' ); ?> |
| 172 |
</p> |
| 173 |
<?php } |
| 174 |
|
| 175 |
/** |
| 176 |
* Displays info for upgrading to MemberPress |
| 177 |
* |
| 178 |
* @since 2.3.0 |
| 179 |
* @access public |
| 180 |
* @param string $link Link for button |
| 181 |
* @return void |
| 182 |
*/ |
| 183 |
function members_memberpress_upgrade( $link = 'https://memberpress.com/plans/pricing' ) { ?> |
| 184 |
|
| 185 |
<div class="mepr-upgrade"> |
| 186 |
<div class="mepr-upgrade-wrap"> |
| 187 |
<div class="mepr-upgrade-content"> |
| 188 |
<h2>Charge Members for Your Protected Content</h2> |
| 189 |
<h4>Members Lite cannot access payments.</h4> |
| 190 |
<p>Once you add MemberPress, you'll be able to charge your members for access to your content.</p> |
| 191 |
<ul class="features"> |
| 192 |
<li>Charge for Access to Content</li> |
| 193 |
<li>Create Memberships, Courses, and Coaching Programs</li> |
| 194 |
<li>Manage Members</li> |
| 195 |
<li>Advanced Reports</li> |
| 196 |
<li>Recurring Payments</li> |
| 197 |
<li>Pro-rated Upgrades</li> |
| 198 |
<li>Centralized Protected Content Management</li> |
| 199 |
<li>Email Marketing Integrations</li> |
| 200 |
</ul> |
| 201 |
</div> |
| 202 |
<div class="mepr-upgrade-cta"> |
| 203 |
<a href="<?php echo esc_url( $link ); ?>" id="mepr_cta_upgrade_link" class="mepr-cta-button">Add MemberPress Now</a> |
| 204 |
and start charging for access! |
| 205 |
</div> |
| 206 |
</div> |
| 207 |
</div> |
| 208 |
|
| 209 |
<?php |
| 210 |
} |
| 211 |
|