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

Link and Script type attributes #210

merged 6 commits into from
Feb 25, 2020

Conversation

vanaf1979
Copy link
Contributor

Theme.php

  • Add theme support for Html5 style and script tags

CleanHead.php

  • Remove id, class, type and media attributes from link tags.
  • Remove type attribute from script tags if WordPress is lower than 5.3.
  • Added \ to core and native functions to indicate the correct namespace.

Im not sure if these changes have to go to the flynt or flynt-starter-theme repo!?
If it has to go into the flynt-starter-theme repo, let me know.

@domtra
Copy link
Member

domtra commented Dec 12, 2019

Hi @vanaf1979, thanks a lot for you pull request. And for the article explaining the new functionality
I have some remarks. Not sure if you want to update the PR yourself or not.

We want to keep a consistent codebase in terms of coding style. While PSR-2 provides a good base, some things are not covered by it and we have not added custom rules to the linting settings.
Here are styling changes I would like to suggest:

  • Do not prefix global WordPress functions with \. While this makes a lot of sense, we do not do it anywhere else.
  • use [] instead of array()

On a more general note, really like that you also fixed the script tag clean up for older versions. This is definitely useful. I would not modify the style tag cleanup, however. This introduces some more cleanup that people might rely on. Especially removing media could lead to unwanted effect. It makes sense to remove an empty media attribute or all, but something like print you would definitely want to stay in there.

- Fixed coding style.
- Removed backslash from function calls
- Reverted back to original style_loader_tag action
@vanaf1979
Copy link
Contributor Author

Hey @domtra,
I adjusted the Pr to your suggestions.

  • Fixed the coding style.
  • Removed backslash from function calls.
  • Reverted back to original style_loader_tag action.

(cherry picked from commit 507bd7a5dc89c9619471d96ab19932641521cbce)
@domtra
Copy link
Member

domtra commented Feb 25, 2020

hey @vanaf1979, we decided to only add this functionality for newer wordpress versions. this way, we do not change the behaviour for older versions either.
thanks a lot again for contributing.

@domtra domtra merged commit 9f08d95 into flyntwp:master Feb 25, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants