REQUIRED: The tags can only contain a call to wp_title().
-
REQUIRED: The <title> tags can only contain a call to wp_title(). Use the wp_title filter to modify the output
This message does not help track down the actual problem. Would you consider adding a link to the file?
// Get correct URL and path to wp-content $content_url = untrailingslashit( dirname( dirname( get_stylesheet_directory_uri() ) ) ); $content_dir = untrailingslashit( dirname( dirname( get_stylesheet_directory() ) ) ); foreach ( $php_files as $file_path => $file_content ) { if ( preg_match( '/(?=<title>(.*)<\/title>)(?!<title>\s*<\?php\s*wp_title\([^\)]*\);\s*\?>\s*<\/title>)/s', $file_content ) ) { // Fix path on Windows $file_path = str_replace( '\\', '/', $file_path ); $content_dir = str_replace( '\\', '/', $content_dir ); $url = str_replace( $content_dir, $content_url, $file_path ); $this->error[] = '<span class="tc-lead tc-required">' . __( 'REQUIRED', 'theme-check').'</span>: ' . __( 'The <strong><title></strong> tags can only contain a call to <strong>wp_title()</strong>. Use the <strong>wp_title filter</strong> to modify the output', 'theme-check' ) . sprintf(' in <a href="%s">%s</a>', $url, basename($file_path)); $ret = false; } }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘REQUIRED: The tags can only contain a call to wp_title().’ is closed to new replies.