Skip to content
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

Add initial docs #314

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/.stylelintrc export-ignore
/.gitignore export-ignore
/.gitattributes export-ignore
/.docs export-ignore
/composer.json export-ignore
/composer.lock export-ignore

Expand Down
13 changes: 13 additions & 0 deletions docs/block-themes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Checks for block themes

Checks that are only run on block themes.

## Required

### FSE Required files

Checks that block themes have the required files:
theme.json
block-templates/index.html

<https://github.com/WordPress/theme-check/blob/master/checks/fse-required-files.php>
1 change: 1 addition & 0 deletions docs/child-themes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Checks for child themes
177 changes: 177 additions & 0 deletions docs/classic-themes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Checks for classic themes

Checks that are only run on classic themes.

## Required

### Basic checks

Checks that the theme contains:
DOCTYPE, language_attributes, charset, wp_body_open, wp_footer, wp_head, add_theme_support( 'automatic-feed-links' );,
body_class, post_class, wp_link_pages.

<https://github.com/WordPress/theme-check/blob/master/checks/basic.php>

### Constants

Checks that the theme does not use the following constants:
STYLESHEETPATH, TEMPLATEPATH, PLUGINDIR, MUPLUGINDIR, HEADER_IMAGE, NO_HEADER_TEXT,
HEADER_TEXTCOLOR, HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, BACKGROUND_COLOR, BACKGROUND_IMAGE

These constants are deprecated, are planned to be deprecated, or have been replaced with add_theme_support arguments.
See <https://core.trac.wordpress.org/changeset/20212>

<https://github.com/WordPress/theme-check/blob/master/checks/constants.php>

### Customizer

Checks for customizer settings without sanitize callbacks, or with empty values as sanitize callbacks.
See <https://developer.wordpress.org/themes/theme-security/>.

<https://github.com/WordPress/theme-check/blob/master/checks/customizer.php>

### Navigation menus

Checks that the theme does not include add_theme_support( "menus" ).
Checks that registered menus includes a theme location and does not include a menu name.

<https://github.com/WordPress/theme-check/blob/master/checks/navmenu.php>

### Post formats

Checks that if theme support for post formats is registered, then the relevant CSS,
get_post_format or has_post_format are used to distinguish them from standard content formats.

<https://github.com/WordPress/theme-check/blob/master/checks/post-formats.php>

### Screen-reader-text CSS class

Checks that the theme styles includes the screen-reader-text CSS class.
The screen-reader-text CSS class is generated by WordPress and needs to be styled with your theme CSS.

<https://github.com/WordPress/theme-check/blob/master/checks/screen-reader-text.php>

### Search form

Checks that searchform.php is not included directly.
To ensure that search form filters can be applied, get_search_form() must be used instead.

<https://github.com/WordPress/theme-check/blob/master/checks/searchform.php>

### Underscores (_s)

Checks if a theme based on underscores (_s) has been correctly updated.

Using underscores.me as Theme URI, Author URI or footer credit link is not allowed.
Using a language file from underscores without updating it to match the new theme is not allowed.

<https://github.com/WordPress/theme-check/blob/master/checks/underscores.php>

### Widgets

Checks that the theme includes:

- dynamic_sidebar(), if a sidebar is registered with register_sidebar().
- register_sidebar(), if dynamic_sidebar() is included.

Checks that register_sidebar() is used together with the widgets_init action hook.

<https://github.com/WordPress/theme-check/blob/master/checks/widgets.php>

## Warning

-

## Recommended

### Comment

Checks that the theme supports comments:
comments_template, wp_list_comments, comment_form.

<https://github.com/WordPress/theme-check/blob/master/checks/comments.php>

#### Comment reply

Checks that the theme enqueues the comment-reply script.

<https://github.com/WordPress/theme-check/blob/master/checks/comment_reply.php>

#### Comment pagination

Checks that the theme supports comment pagination:
paginate_comments_links, the_comments_navigation, the_comments_pagination, next_comments_link, previous_comments_link.

<https://github.com/WordPress/theme-check/blob/master/checks/commpage.php>

### Deprecated (recommended)

Checks that the theme does not use deprecated functions:
preview_theme, _preview_theme_template_filter, _preview_theme_stylesheet_filter,
preview_theme_ob_filter, preview_theme_ob_filter_callback, wp_richedit_pre,
wp_htmledit_pre, wp_ajax_wp_fullscreen_save_post, post_permalink, wp_get_http,
force_ssl_login, create_empty_blog, get_admin_users_for_domain

### Editor style

Check that add_editor_style is included in the theme.

<https://github.com/WordPress/theme-check/blob/master/checks/editorstyle.php>

### Navigation menu support

Checks that the theme supports navigation menus.

<https://github.com/WordPress/theme-check/blob/master/checks/navmenu.php>

### Post navigation and pagination

Checks that the theme supports post navigation:
posts_nav_link, paginate_links, the_posts_pagination, the_posts_navigation, previous_posts_link, next_posts_link

<https://github.com/WordPress/theme-check/blob/master/checks/post-pagination-navigation.php>

### Post thumbnails

Checks that the theme includes add_theme_support( 'post-thumbnails' ).
Checks that the theme presents images with the_post_thumbnail().

<https://github.com/WordPress/theme-check/blob/master/checks/postthumb.php>

### Suggested styles

Checks for Theme URI and Author URI.

Checks for styling of tags that are generated by WordPress:
sticky, bypostauthor, alignleft, alignright, aligncenter, wp-caption, wp-caption-text, gallery-caption

<https://github.com/WordPress/theme-check/blob/master/checks/style_suggested.php>

### Tags

Checks that the theme displays tags:
the_tags, the_taxonomies, get_the_tag_list, get_the_term_list

<https://github.com/WordPress/theme-check/blob/master/checks/tags.php>

### Theme Support

Checks that the theme includes add_theme_support:
custom-header, custom-background, custom-logo, html5, responsive-embeds, align-wide, wp-block-styles

<https://github.com/WordPress/theme-check/blob/master/checks/theme-support.php>

### Widget Support

Checks that the theme supports widgets by including dynamic_sidebar and register_sidebar.

<https://github.com/WordPress/theme-check/blob/master/checks/widgets.php>

## Info

### Include

Checks if the theme uses include or require and informats that templates
should be included using get_template_part instead.

<https://github.com/WordPress/theme-check/blob/master/checks/include.php>
Loading