Go to file
Gary Pendergast b665b5c7d8 Roles/Capabilities: Add a new `wp_roles_init` filter.
Historically, it's been difficult to extend user roles, but reasonable to work around by waiting until after `init` has fired, to add custom roles and capabilities. With the addition of Locale Switching, Core now potentially loads roles before `init` has fired, leaving a window where custom roles and capabilities are not handled.

The new filter allows plugins to add their own custom roles whenever they're initialised (on page load, or when switching sites, for example), so that they can always be obeyed.

`WP_Roles` has also been tidied up a little bit, to remove duplicate code.

Props johnjamesjacoby, pento.
Fixes #23016.



git-svn-id: https://develop.svn.wordpress.org/trunk@39082 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-02 00:30:29 +00:00
src Roles/Capabilities: Add a new `wp_roles_init` filter. 2016-11-02 00:30:29 +00:00
tests Roles/Capabilities: Add a new `wp_roles_init` filter. 2016-11-02 00:30:29 +00:00
tools/i18n
.editorconfig
.gitignore
.jshintrc
.travis.yml
Gruntfile.js Build/Test Tools: Allow Minimal Builds 2016-10-20 22:23:21 +00:00
package.json
phpunit.xml.dist
wp-cli.yml
wp-config-sample.php
wp-tests-config-sample.php Tests: Use a minimal theme for tests. 2016-10-21 11:02:37 +00:00