Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
9b2801a
Merge tag '1.1.1' into dev
Jan 9, 2016
15d781c
Add a warning message when the user is editing the administrator role.
Jun 14, 2016
7db33f0
Whitelist the BuddyPress activation page in private site mode. Props…
Jun 14, 2016
f30a01b
Introduce the `members_is_public_page()` and accompanying filter hook…
Jun 14, 2016
2f632b2
Change `members_is_public_page()` to `members_is_private_page()`. Th…
Jun 14, 2016
1aa77e2
Merge remote-tracking branch 'remotes/origin/master' into dev
Jun 22, 2016
0468077
Adds WooCommerce account page support to the private site feature. D…
Oct 4, 2016
bf0f3ba
Use `<h2>` instead of `<h3>` for proper admin heading hierarchy. Pro…
Oct 4, 2016
f223264
Adds the `members_enable_{$post_type}_content_permissions` filter hoo…
Oct 4, 2016
e822ea6
Add context for the "Add New" text string to differentiate between ad…
Oct 7, 2016
36236b6
Fix switched `id_remember` and `id_submit` keys from the `$instance` …
Oct 7, 2016
44a5e0e
Remove core customize changeset and custom CSS post types from the ca…
Feb 6, 2017
4d919bf
Make sure the role is editable before attempting to add a new role to…
Feb 6, 2017
37618dd
Remove `customize_changeset` and `custom_css` from the post type cap …
Feb 6, 2017
31fa346
Update changelog.md.
Feb 6, 2017
cda5418
Update readme.txt.
Feb 6, 2017
08c0509
Version bump to 1.1.3.
Feb 6, 2017
60ec28b
Merge branch '1.1' into dev
Feb 6, 2017
48e346c
Merge branch '1.1'
Feb 6, 2017
a3a1ce0
Bug fix: Separate multiple role states with a comma. Currently, ther…
Feb 7, 2017
eb1653d
Role states array values should have hardcoded keys so that they can …
Feb 7, 2017
168bae8
First pass at creating a settings page view system where there can be…
justintadlock Jun 22, 2017
f7816cc
Adds the `.wp-tab-panel` wrapper around the user roles checklist on t…
justintadlock Jun 23, 2017
5aa4d9e
Don't save content permissions on autosave or for post revisions.
justintadlock Jun 23, 2017
970442c
First pass at a capability registration system. Primarily, this syst…
justintadlock Jun 24, 2017
c1c750a
Prevent users from adding the `do_not_allow` capability to roles. Fi…
justintadlock Jun 24, 2017
c428b51
Register the "all" cap group last.
justintadlock Jun 24, 2017
a3e992d
Add a new `members_priority_sort()` function for sorting objects by p…
justintadlock Jun 24, 2017
9935fd1
Use the `members_priority_sort()` function for sorting settings views.
justintadlock Jun 24, 2017
2d3ca47
Complete overhaul of the factory-registry patterned classes previousl…
justintadlock Jun 26, 2017
ad162b2
Bring the `Members\Role_Group` class up to date with similar classes.
justintadlock Jun 26, 2017
143b5aa
Update copyright date and email in all file headers.
justintadlock Jun 26, 2017
6179f2f
Version bump to 2.0.0-dev.
justintadlock Jun 26, 2017
edc4c8b
Improve some escaping and sanitizing based on https://github.com/just…
justintadlock Jun 26, 2017
ad1f877
Move the post type "public" check and attachment check into the `mayb…
justintadlock Jun 26, 2017
3c90dcd
Change the text in the content permissions meta box to use "content" …
justintadlock Jun 26, 2017
60b4397
Use the `$old_user_data` parameter (user object) to update the user r…
justintadlock Jun 26, 2017
9c18759
Correct year in change log. Fixes: https://github.com/justintadlock/…
justintadlock Jun 26, 2017
4fbd1ac
First pass at a new manage users class. This commit's primary purpos…
justintadlock Jun 27, 2017
71cc077
Move the users column management functionality to the manage users cl…
justintadlock Jun 27, 2017
bafe62d
Use `members_unregister_role()`.
justintadlock Jun 27, 2017
d95567e
When multiple roles are enabled, add a multi-role checkbox to the Add…
justintadlock Jun 28, 2017
d51a42e
Use the newer `members_unregister_role()` and `members_register_role(…
justintadlock Jun 28, 2017
0c1a3ec
Move the widget classes to the `Members` namespace.
justintadlock Jun 28, 2017
b6c58cb
Bump 'custom' and 'all' cap groups up really high in priority.
justintadlock Jun 29, 2017
baf73a6
Add core taxonomy caps to the WP caps array.
justintadlock Jun 29, 2017
b7ca5d0
Temporarily comment out taxonomy caps until we best figure out how to…
justintadlock Jun 29, 2017
3bab2d1
Use `wp_editor()` to output the WP Editor instead of a plain textarea…
justintadlock Jun 29, 2017
051da2c
Adds the `[members_not_logged_in]` shortcode for showing content to u…
justintadlock Jun 29, 2017
cc2fa5e
Adds the `members_default_post_roles` filter hook. This hook allows …
justintadlock Jun 29, 2017
14b8c6f
Use the `wp_roles_init` hook added in WP 4.7 to to register our roles.
justintadlock Jun 29, 2017
176cc4e
Add a private REST API option to disable for users who are not logged…
justintadlock Jun 29, 2017
3e5875c
Drop parameter type hinting for now.
justintadlock Jun 30, 2017
948d342
Disables access to private blogs in multisite where the user is logge…
justintadlock Jul 1, 2017
b00dc0b
Adds a `members_has_post_roles()` conditional tag. Partial fix for h…
justintadlock Jul 2, 2017
0d9a028
Filter `get_comment_text` instead of just `comment_text_rss` to make …
justintadlock Jul 2, 2017
d170ba1
Create a tabbed interface for the Content Permissions meta box.
justintadlock Jul 3, 2017
5e57874
Adds the `members_has_post_permissions()` function. Currently, this …
justintadlock Jul 4, 2017
b0a03ee
Use jQuery to hide role-related fields that WP outputs on the manage …
justintadlock Jul 4, 2017
6d02adf
Adds the `operator` parameter to the `[members_access]` shortcode. C…
justintadlock Jul 5, 2017
25201ca
Adds a `composer.json` file. Props @jlambe
justintadlock Jul 5, 2017
92808cf
Add `composer/installers` requirement to `composer.json`.
justintadlock Jul 5, 2017
0edbc53
Adds a link to the Roles and Capabilities page in the WordPress Codex…
justintadlock Jul 5, 2017
7dc84b1
Typo fix: "no" should be "not".
justintadlock Jul 5, 2017
85a4b47
Better handling of the taxonomy caps that are mapped to `manage_categ…
justintadlock Jul 5, 2017
a7e9b89
Update all references to `http` to `https` for `themehybrid.com`.
justintadlock Jul 5, 2017
03bc42c
First pass at integrating with an external API for handling add-ons. …
justintadlock Jul 8, 2017
22ae6cd
Adds a temporary `addons.json` file for testing the add-ons page.
justintadlock Jul 10, 2017
63c01c5
Use the `Members\Admin` namespace for settings classes.
justintadlock Jul 10, 2017
9c7668c
Rename view class files.
justintadlock Jul 10, 2017
e9e8087
Move cap and role group classes and functions files to the `inc` dire…
justintadlock Jul 10, 2017
e55ef6d
Update admin classes to use the `Members\Admin` namespace.
justintadlock Jul 10, 2017
e81cfe1
Separate registering default role and cap groups into their own funct…
justintadlock Jul 10, 2017
18eee79
Put the add-on icons into the `img` folder. This will allow us to sa…
justintadlock Jul 11, 2017
ea20a45
Only show add-on card footer if there's a rating or install count.
justintadlock Jul 12, 2017
0e0762d
Officially start using the API from ThemeHybrid.com for handling the …
justintadlock Jul 12, 2017
4343cba
Update screenshots.
justintadlock Jul 12, 2017
e00ba78
Remove most of the `_dir` and `_uri` paths. We're going with a simpl…
justintadlock Jul 12, 2017
ca36539
Change `/languages` folder to `/lang` for consistency with other plug…
justintadlock Jul 12, 2017
4b03387
Add help tabs for the add-ons view.
justintadlock Jul 12, 2017
f12f62d
Add a unique name to the settings page. This way, the info is passed…
justintadlock Jul 12, 2017
b4e2f3b
Remove unused settings field code.
justintadlock Jul 12, 2017
980c8ac
Use the `$name` property when registering the settings page.
justintadlock Jul 13, 2017
2cd3452
Remove unused variables.
justintadlock Jul 13, 2017
ec409b8
Adds a `load()` method for admin/setting views that executes on the `…
justintadlock Jul 13, 2017
319e331
The base `View` class should be abstract.
justintadlock Jul 13, 2017
751c7c7
Typo fix: "downloads" should be "add-ons".
justintadlock Jul 13, 2017
6c1e677
Deactivate the plugin and die if not running PHP 5.3.0+. Fixes: http…
justintadlock Jul 13, 2017
88a075e
Bring the documentation in the `readme.md` file more up to date.
justintadlock Jul 13, 2017
ce3eeb5
Remove all role groups except for the `wordpress` group. The other g…
justintadlock Jul 13, 2017
0137225
More role views cleanup.
justintadlock Jul 13, 2017
489ce54
Remove the "All" cap group. While this is a capability tab on the ed…
justintadlock Jul 13, 2017
25e0073
Update registry class info.
justintadlock Jul 13, 2017
62a0cdd
General code and file cleanup.
justintadlock Jul 16, 2017
ed0bbac
Role group object should check if any roles were already registered t…
justintadlock Jul 16, 2017
3576392
Move unused cap group functions to `functions-deprecated.php`.
justintadlock Jul 16, 2017
dd56618
Introduce the following filter hooks for the private site feature:
justintadlock Jul 16, 2017
6214294
Add note that PHP 5.3.0+ is required in the `readme.txt`.
justintadlock Jul 17, 2017
6d6996f
Update help tabs text for the general settings screen.
justintadlock Jul 18, 2017
de2b831
Remove the unused `addons.json` file.
justintadlock Jul 18, 2017
d411038
General file and code cleanup.
justintadlock Jul 18, 2017
8dcf680
Update the `members.pot` file.
justintadlock Jul 18, 2017
ea7ab94
Use `members_get_role()`.
justintadlock Jul 19, 2017
1a425d0
Update readme files.
justintadlock Jul 19, 2017
8fff93b
Big ass change log update for 2.0.0.
justintadlock Jul 19, 2017
97ed3f6
Minor adjustments to the change log.
justintadlock Jul 19, 2017
c5c61bd
Update plugin tags.
justintadlock Jul 19, 2017
622ad12
Merge branch 'dev'
justintadlock Jul 19, 2017
79b2b6f
Version bump to 2.0.0.
justintadlock Jul 19, 2017
5c02897
Merge branch 'dev'
justintadlock Jul 19, 2017
be57d4f
Version bump to 2.0.1-dev.
justintadlock Jul 21, 2017
893a858
Add the `show_human_caps` option to the settings validation callback.…
justintadlock Jul 21, 2017
8f46fe5
Bumps the priority of all the default cap groups back 5. Leaves the …
justintadlock Jul 21, 2017
1619b0f
Change `$user` to `$old_user_data`. Otherwise, we can't properly han…
justintadlock Jul 23, 2017
e536069
Better handling of the PHP 5.3.0+ minimum requirement. Instead of ju…
justintadlock Jul 25, 2017
dc703b7
First pass at fixing roles not being added to new users created in a …
justintadlock Aug 25, 2017
720fae9
Correct typo function name.
justintadlock Aug 25, 2017
8917cf3
Super admins should be able to see private sites, even if they're not…
justintadlock Sep 27, 2017
573dd36
Make sure role labels are translated where the plugin outputs them. …
justintadlock Sep 27, 2017
9c51f6c
In a multisite scenario with the multiple roles per user featured ena…
justintadlock Sep 27, 2017
b2ed66f
Filter the user signup activation email. And remove the core WP filt…
justintadlock Sep 27, 2017
829b781
Correct hook callback fix on previous commit. Ref: https://github.co…
justintadlock Sep 27, 2017
d771f1c
Don't show the multi-role selection form field when adding a new user…
justintadlock Sep 28, 2017
d7f95f9
Bump the callback priority on `user_register` up a little to make sur…
justintadlock Sep 28, 2017
ccb2a38
Update change log.
justintadlock Sep 28, 2017
39a95c8
Update `readme.txt`.
justintadlock Sep 28, 2017
1c92db7
Domain path should be `/lang`.
justintadlock Sep 28, 2017
1b71c95
Version bump to 2.0.1.
justintadlock Sep 28, 2017
5dab19e
Merge branch '2.0'
justintadlock Sep 28, 2017
428d013
This commit makes several changes dealing with editing roles on a mul…
justintadlock Nov 3, 2017
3ff98e6
Network-specific caps shouldn't even appear for super admins in multi…
justintadlock Nov 3, 2017
a3561f1
Allow the `setup_network` cap on single site but not multisite becaus…
justintadlock Nov 3, 2017
591e95a
With any luck, this finally fixes the role label translation issue. …
justintadlock Nov 6, 2017
e89a9db
Update the change log.
justintadlock Nov 6, 2017
8befa78
Readme updates.
justintadlock Nov 6, 2017
e34b775
Version bump to 2.0.2.
justintadlock Nov 6, 2017
e4dc8a8
Merge branch '2.0'
justintadlock Nov 6, 2017
8963608
Make sure to remove slashes from posted role label.
justintadlock Jan 7, 2018
2a1230c
Version bump to 2.0.3-dev.
justintadlock Feb 8, 2018
be701d6
`wp_roles_init` may be called multiple times. Let's make sure that th…
justintadlock Feb 8, 2018
ff868d3
Version bump to 2.1.0-dev.
justintadlock Apr 18, 2018
e1d5b1c
Adds the `user_name`, `user_id`, and `user_email` parameters to the `…
justintadlock Apr 18, 2018
2e0f48a
Bring in the fix from the dev branch to fix the invalid icon URL.
justintadlock Apr 18, 2018
7dc5d5a
Adds the `icon-members-core-create-caps.png` file to keep resources o…
justintadlock Apr 18, 2018
317ea17
Add a check for whether a page ID was returned when checking WooComme…
justintadlock Apr 18, 2018
15e3cdf
Update `changelog.md`.
justintadlock Apr 19, 2018
259f6b5
Update copyright dates.
justintadlock Apr 19, 2018
76dd7f8
Do a soft bump of the PHP requirement to 5.6+. The code still support…
justintadlock Apr 19, 2018
02e5ede
Update `readme.txt`.
justintadlock Apr 19, 2018
7c397fd
Update `readme.md` to include info on the new `[members_access]` shor…
justintadlock Apr 19, 2018
8f27987
Version bump to 2.1.0.
justintadlock Apr 19, 2018
ef0b833
Merge branch '2.1'
justintadlock Apr 19, 2018
bfd25e3
Make sure denied caps are always an array. Fixes: https://github.com…
justintadlock Jul 19, 2019
1831b17
Updates the add-ons admin screen with a new design and pro upgrade se…
justintadlock Jul 19, 2019
d75a440
Link to users list for a specific role when editing that role. Also …
justintadlock Jul 19, 2019
78abc37
Version bump to 2.2.0-alpha.
justintadlock Jul 19, 2019
2cf49f3
Make sure we have a valid post object when checking if a user can vie…
justintadlock Jul 19, 2019
b4c39b2
Typo fix. Fixes: https://github.com/justintadlock/members/pull/192
justintadlock Jul 20, 2019
9f048c4
Update change log.
justintadlock Jul 20, 2019
740c360
Update POT file.
justintadlock Jul 20, 2019
2a881c1
Update readme with an example of how denied caps work.
justintadlock Jul 20, 2019
bb65a39
Use minified CSS.
justintadlock Jul 20, 2019
b716a96
Remove support-only membership text link.
justintadlock Jul 20, 2019
19c93b8
Version bump to 2.2.0.
justintadlock Jul 20, 2019
72fe546
Update readme.
justintadlock Jul 20, 2019
7dbefeb
Correct date in change log.
justintadlock Jul 20, 2019
07a1eee
Merge branch '2.2'
justintadlock Jul 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions admin/class-addon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<?php
/**
* Class for handling an add-on object.
*
* @package Members
* @subpackage Admin
* @author Justin Tadlock <justintadlock@gmail.com>
* @copyright Copyright (c) 2009 - 2018, Justin Tadlock
* @link https://themehybrid.com/plugins/members
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/

namespace Members;

/**
* Add-on object class.
*
* @since 2.0.0
* @access public
*/
final class Addon {

/**
* Name/ID for the addon.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $name = '';

/**
* Title of the add-on.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $title = '';

/**
* Short description of the add-on.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $excerpt = '';

/**
* URL where the add-on can be found.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $url = 'https://themehybrid.com/plugins/members';

/**
* Add-on ZIP file URL.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $download_url = '';

/**
* Alternate purchase URL.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $purchase_url = '';

/**
* URL for a 128x128 (size used by WordPress.org) icon image.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $icon_url = '';

/**
* Add-on plugin's author URL.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $author_url = '';

/**
* Add-on plugin's author display name.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $author_name = '';

/**
* Rating for the add-on. This is the total rating based on a 5-star rating system.
* It will be divided by the rating count, so both must be supplied.
*
* @since 2.0.0
* @access protected
* @var int
*/
public $rating = '';

/**
* Number of ratings.
*
* @since 2.0.0
* @access protected
* @var int
*/
public $rating_count = 0;

/**
* Number of active installs. Note that this will be displayed with a `+` at
* the end, such as `100,000+`. Exact counts are necessary. Just a round number.
*
* @since 2.0.0
* @access protected
* @var string
*/
public $install_count = 0;

/**
* Magic method to use in case someone tries to output the object as a string.
* We'll just return the name.
*
* @since 2.0.0
* @access public
* @return string
*/
public function __toString() {
return $this->name;
}

/**
* Register a new object.
*
* @since 2.0.0
* @access public
* @param string $name
* @param array $args {
* @type string $label Internationalized text label.
* @type string $icon Dashicon icon in the form of `dashicons-icon-name`.
* @type array $caps Array of capabilities in the addon.
* @type bool $merge_added Whether to merge this caps into the added caps array.
* @type bool $diff_added Whether to remove previously-added caps from this addon.
* }
* @return void
*/
public function __construct( $name, $args = array() ) {

foreach ( array_keys( get_object_vars( $this ) ) as $key ) {

if ( isset( $args[ $key ] ) )
$this->$key = $args[ $key ];
}

$this->name = sanitize_key( $name );

if ( ! $this->icon_url )
$this->icon_url = members_plugin()->uri . 'img/icon-addon.png';
}
}
27 changes: 15 additions & 12 deletions admin/class-cap-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
*
* @package Members
* @subpackage Admin
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2009 - 2016, Justin Tadlock
* @link http://themehybrid.com/plugins/members
* @author Justin Tadlock <justintadlock@gmail.com>
* @copyright Copyright (c) 2009 - 2018, Justin Tadlock
* @link https://themehybrid.com/plugins/members
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/

namespace Members\Admin;

/**
* Cap control class.
*
* @since 1.0.0
* @since 2.0.0
* @access public
*/
final class Members_Cap_Control {
final class Cap_Control {

/**
* Stores the cap tabs object.
*
* @see Members_Cap_Tabs
* @since 1.0.0
* @since 2.0.0
* @access public
* @var object
*/
Expand All @@ -31,7 +33,7 @@ final class Members_Cap_Control {
/**
* Name of the capability the control is for.
*
* @since 1.0.0
* @since 2.0.0
* @access public
* @var string
*/
Expand All @@ -40,7 +42,7 @@ final class Members_Cap_Control {
/**
* ID of the section the control is for.
*
* @since 1.0.0
* @since 2.0.0
* @access public
* @var string
*/
Expand All @@ -49,7 +51,7 @@ final class Members_Cap_Control {
/**
* Array of data to pass as a json object to the Underscore template.
*
* @since 1.0.0
* @since 2.0.0
* @access public
* @var array
*/
Expand All @@ -58,7 +60,7 @@ final class Members_Cap_Control {
/**
* Creates a new control object.
*
* @since 1.0.0
* @since 2.0.0
* @access public
* @param object $manager
* @param string $cap
Expand All @@ -80,7 +82,7 @@ public function __construct( $manager, $cap, $args = array() ) {
/**
* Returns the json array.
*
* @since 1.0.0
* @since 2.0.0
* @access public
* @return array
*/
Expand All @@ -92,7 +94,7 @@ public function json() {
/**
* Adds custom data to the json array. This data is passed to the Underscore template.
*
* @since 1.0.0
* @since 2.0.0
* @access public
* @return void
*/
Expand All @@ -112,6 +114,7 @@ public function to_json() {

// Set up the input labels.
$this->json['label'] = array(
'cap' => members_show_human_caps() && members_cap_exists( $this->cap ) ? members_get_cap( $this->cap )->label : $this->cap,
'grant' => sprintf( esc_html__( 'Grant %s capability', 'members' ), "<code>{$this->cap}</code>" ),
'deny' => sprintf( esc_html__( 'Deny %s capability', 'members' ), "<code>{$this->cap}</code>" )
);
Expand Down
115 changes: 0 additions & 115 deletions admin/class-cap-group-factory.php

This file was deleted.

Loading