-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin Territory Functions #81
Plugin Territory Functions #81
Conversation
*/ | ||
public function getGroups() { | ||
return array( | ||
'filefunctions' => array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name this plugin-territory
563cd1d
to
6671823
Compare
* @package PHP_CodeSniffer | ||
* @author khacoder | ||
*/ | ||
class WordPress_Sniffs_Theme_PluginTerritoryFunctionsSniff extends WordPress_Sniffs_Functions_FunctionRestrictionsSniff { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should extend the abstract function restrictions sniff
* @category PHP | ||
* @package PHP_CodeSniffer | ||
* @link https://make.wordpress.org/core/handbook/best-practices/coding-standards/ | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before: please update and the same goes for the other docblocks.
Initial commit. Issue #73
@jrfnl The checks are passing on this too. |
/** | ||
* Restricts the use of various functions that are plugin territory. | ||
* | ||
* @link https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#regular-expressions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the link to a relevant URL in the theme review handbook
return array( | ||
'plugin-territory' => array( | ||
'type' => 'error', | ||
'message' => '%s() is not allowed because it is a plugin territory function.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if this would read better - feel free to disregard if you don't agree:
Function %s() is not allowed because it is plugin territory
register_taxonomy_for_object_type( 'category', 'page' ); | ||
flush_rewrite_rules( false ); | ||
|
||
xyz_add_shortcode(); // OK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add these too ?
My_Plugin_Class::add_shortcode();
$my_plugin_object->add_shortcode();
Requested changes added. |
* @package PHP_CodeSniffer | ||
* @author khacoder | ||
* @package WPCS\WordPressCodingStandards | ||
* @since 0.10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@since 0.xx.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arg, in my copy and paste I missed that. Has been fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happens to the best of us ;-)
Initial PR
Issue #73