Skip to content

Commit

Permalink
Restrict roles
Browse files Browse the repository at this point in the history
  • Loading branch information
grappler committed Jan 30, 2017
1 parent 35cb879 commit cd34a9c
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions WordPress/Sniffs/Theme/RestrictedPHPFunctionsSniff.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<?php
/**
* WordPress_Sniffs_Theme_RestrictedPHPFunctionsSniff.
* WordPress Coding Standard.
*
* Forbids the use of certain exec and obfuscation functions within Themes.
* @package WPCS\WordPressCodingStandards
* @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
* @license https://opensource.org/licenses/MIT MIT
*/

/**
* Forbids usage of certain fuctions and recommends alternatives.
*
* @category Theme
* @package PHP_CodeSniffer
* @author Juliette Reinders Folmer <wpplugins_nospam@adviesenzo.nl>
* @package WPCS\WordPressCodingStandards
*
* @since 0.xx.0
*/
class WordPress_Sniffs_Theme_RestrictedPHPFunctionsSniff extends WordPress_Sniffs_Functions_FunctionRestrictionsSniff {

Expand Down Expand Up @@ -66,7 +72,18 @@ public function getGroups() {
'str_rot13',
),
),

'roles' => array(
'type' => 'error',
'message' => '%s() is not allowed. Use capabilities instead.',
'functions' => array(
'add_role',
'remove_role',
'get_role',
),
),
);

}
} // end class

} // End class.

0 comments on commit cd34a9c

Please sign in to comment.