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

feat: rework of PHP files. #152

Merged
merged 6 commits into from
May 21, 2024
Merged

feat: rework of PHP files. #152

merged 6 commits into from
May 21, 2024

Conversation

Levdbas
Copy link
Member

@Levdbas Levdbas commented May 2, 2024

This is the first changes in a larger set of changes that I am going to propose.

Related:

Issue

Since the creation of the starter theme a lot has happened in PHP, WordPress and Timber. I want to make the starter-theme a more modern starting point for custom theme development.

Solution

This particular PR focusses on overhauling the PHP files to:

  • Be namespaced
  • Have less confusing docblocks
  • Use the new way of passing context to the templates

Impact

A better, less confusing, start with templating in Timber.

Usage Changes

Code is now namespaced, so people will have to add filters/actions with a namespace reference as well. In a next PR I will also solely focus on the starttheme class.

Considerations

This is not adhering to any code style yet, I would like to introduce that soon as well and thus lint the whole codebase.

Testing

I might try to add some overall tests in the upcoming few PR's

archive.php Outdated Show resolved Hide resolved
author.php Outdated Show resolved Hide resolved
functions.php Outdated Show resolved Hide resolved
single.php Outdated Show resolved Hide resolved
archive.php Outdated Show resolved Hide resolved
archive.php Show resolved Hide resolved
Copy link
Member

@gchtr gchtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these improvements and moving PHP files more towards our Timber standard.

I found some things to look at and I added separate comments for those.

@Levdbas Levdbas mentioned this pull request May 20, 2024
@Levdbas
Copy link
Member Author

Levdbas commented May 20, 2024

@gchtr , I went over all your requests. As mentioned, I would like to discuss how the starter theme should look like but all other items are done!

@gchtr
Copy link
Member

gchtr commented May 21, 2024

@Levdbas Thanks for the updates! This looks good to me.

Hit me up with anything you want to discuss :):

@Levdbas Levdbas merged commit 0a6cb4d into 2.x May 21, 2024
9 checks passed
@Levdbas Levdbas deleted the update-template-php-files branch May 21, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor to namespaces
2 participants