You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create new theme sniff class that will create a theme data array that will be accessible by other sniffs during a theme check. The theme data will consist of data pulled from the style.css file.
Example array content.
$theme_data = array(
'theme_name' => 'Name of Theme',
'theme_uri' => 'www.theme.uri',
'theme_author' => '
'theme_author' => 'Author Name',
'theme_author_uri' => 'www.author.uri',
'theme_description' => 'Description of theme from style.css',
'theme_version' => '0.0.1',
'theme license' => 'GPLv2 or later',
'theme_license_uri' => 'http://www.gnu.org/licenses/gpl-2.0.html',
'theme_tags' => array( theme tags from style.css),
'text_domain' => 'text domain from style.css',
Elements not in style.css will be blank, for example 'theme_uri' => '',
Sniffs that need the $theme_data array, should set up the class with extends WordPress ThemeSniff.
The array is then accessed with $this->theme_data.
Issues:
Conventional testing of sniffs that use this class is not possible because style.css will be required in addition to a test file.
To do:
develop and add Class
test Class with a sniff that uses theme data
The text was updated successfully, but these errors were encountered:
[New class] Create Theme Sniff Class
Create new theme sniff class that will create a theme data array that will be accessible by other sniffs during a theme check. The theme data will consist of data pulled from the style.css file.
Example array content.
$theme_data = array(
'theme_name' => 'Name of Theme',
'theme_uri' => 'www.theme.uri',
'theme_author' => '
'theme_author' => 'Author Name',
'theme_author_uri' => 'www.author.uri',
'theme_description' => 'Description of theme from style.css',
'theme_version' => '0.0.1',
'theme license' => 'GPLv2 or later',
'theme_license_uri' => 'http://www.gnu.org/licenses/gpl-2.0.html',
'theme_tags' => array( theme tags from style.css),
'text_domain' => 'text domain from style.css',
Elements not in style.css will be blank, for example 'theme_uri' => '',
Sniffs that need the $theme_data array, should set up the class with
extends WordPress ThemeSniff
.The array is then accessed with $this->theme_data.
Issues:
Conventional testing of sniffs that use this class is not possible because style.css will be required in addition to a test file.
To do:
The text was updated successfully, but these errors were encountered: