Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Link and Script type attributes #210

Merged
merged 6 commits into from
Feb 25, 2020
Merged
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
11 changes: 0 additions & 11 deletions inc/cleanHead.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,3 @@
$media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media="' . $matches[3][0] . '"' : '';
return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n";
});

/**
* cleanScriptTag
*
* Clean up output of <script> tags
* TODO: fix or remove (broken on wp > 5.0.0)
*/
// add_filter('script_loader_tag', function ($input) {
// $input = str_replace("type='text/javascript' ", '', $input);
// return str_replace("'", '"', $input);
// });
5 changes: 5 additions & 0 deletions inc/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
add_action('after_setup_theme', function () {
add_theme_support('title-tag');
add_theme_support('post-thumbnails');

/**
* Remove type attribute from link and script tags.
*/
add_theme_support('html5', ['script', 'style']);
});

add_filter('big_image_size_threshold', '__return_false');