Skip to content

Move GP core function to init hook to fix translation error - Take two#1055

Merged
mauteri merged 5 commits intoGatherPress:developfrom
jmarx:jmarx-1021-translation-bug-main
Apr 21, 2025
Merged

Move GP core function to init hook to fix translation error - Take two#1055
mauteri merged 5 commits intoGatherPress:developfrom
jmarx:jmarx-1021-translation-bug-main

Conversation

@jmarx
Copy link
Copy Markdown
Collaborator

@jmarx jmarx commented Apr 21, 2025

Description of the Change

Move sub pages core function to init hook to remove translations notice.

Closes #1021

How to test the Change

Switch your language setting to Dutch and turn on debug mode and ensure you don't get a notice about the translation functionality loading too late.

Changelog Entry

Fixed - Bug fix

Credits

Props @mauteri, @jmarx

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Apr 21, 2025

PR Summary

  • Reorganizing Execution of Main Sub Page Setup
    The command to set up the main sub page was removed from the initial setup process, providing more flexibility.

  • Implemented Action Hook to Init for Main Sub Page Setup
    To optimize the application's operation, a new hook has been added to the initialization process. This ensures the main sub page gets set up at the most optimal time during initialization.

  • Increased Accessibility of Main Sub Page Setup
    The main sub page setup process has been made more accessible by making it a public function. This change allows other parts of the application to trigger or use this process, improving the application's overall versatility and adaptability.

@jmarx jmarx requested a review from mauteri April 21, 2025 11:46
* @return void
*/
protected function setup_hooks(): void {
add_action( 'init', array( $this, 'set_main_sub_page' ) );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did you add this and the empty callbacks?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@mauteri Fixed

@github-actions
Copy link
Copy Markdown
Contributor

Preview changes with Playground

You can preview the recent changes for PR#1055 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@jmarx jmarx requested a review from mauteri April 21, 2025 12:29
@mauteri mauteri merged commit 99591e6 into GatherPress:develop Apr 21, 2025
27 checks passed
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.

Translation notice

2 participants