adds skip links check for block themes#457
adds skip links check for block themes#457MaggieCabrera wants to merge 12 commits intoWordPress:masterfrom
Conversation
|
We might want to check if there's multiple tags too |
|
It would be nice to make the |
|
I fixed those! ready for another review |
Co-authored-by: Matias Benedetto <matias.benedetto@gmail.com>
| return false; | ||
| } | ||
|
|
||
| $files = glob( $theme_dir . '/' . $directory . '/*.php' ); |
There was a problem hiding this comment.
It looks like $php_files doesn't store the contents of the comment in the pattern, so I have no way of checking if the slug of the pattern is the one I'm trying to match
There was a problem hiding this comment.
seems like that's done here so I will leave this part of the code as I implemented it:
Line 61 in b2b4cec
|
I checked by removing Would you please let me know how did you test that? |
I find it. I was checking different PR. Sorry! |
|
REQUIRED Skip links are missing from the following templates: single.html, single.html Please make sure the templates have a tag.Why the message show |
I haven't seen that on my tests, what did you try to get that to happen? |
|
In single.html file of TT4 theme, I simply changed |
|
I think I found the reason, |
I just fixed this |
|
Sorry, I have been super busy; I just caught up with the reviews. It should be ready to go now! |
| /** | ||
| * Returns true if the theme is a block theme. | ||
| * | ||
| * @var array $is_block_theme | ||
| */ | ||
| protected $is_block_theme = false; | ||
|
|
||
| /** | ||
| * The WP_Theme instance being checked. | ||
| * | ||
| * @var WP_Theme $wp_theme | ||
| */ | ||
| protected $wp_theme = false; | ||
|
|
||
| function set_context( $data ) { | ||
| if ( isset( $data['theme'] ) ) { | ||
| $this->wp_theme = $data['theme']; | ||
| $this->is_block_theme = wp_is_block_theme(); | ||
| } |
There was a problem hiding this comment.
As far as I can see is_block_theme is not being used in this check class. Is it used somewhere?
There was a problem hiding this comment.
I think the Skip_Links_Check class needs to be added to the list of FSE specific checks here:
Lines 386 to 387 in dabaf1d
So this line needs to be removed:
theme-check/checks/class-skip-links.php
Line 152 in dabaf1d
See FSE_Required_Files_Check class as reference.

This PR adds a check only for block themes to see if templates have a main tag present. If they don't they will be missing the skip links from said template.
I need to check when a template is made out of a pattern and the main tag will be inside the pattern instead of the template file