-
Notifications
You must be signed in to change notification settings - Fork 198
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
Register blocks to make translations available in the editor #7643
Conversation
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
1d0d8af
to
315b511
Compare
Test the previous changes of this PR with WordPress Playground. |
315b511
to
2717c96
Compare
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as described - all blocks are translated! 🎉
@@ -22,21 +22,53 @@ public function __construct() { | |||
Sensei_Blocks::register_sensei_block( | |||
'sensei-lms/quiz-question', | |||
[ | |||
'render_callback' => [ $this, 'render_quiz_question' ], | |||
'render_callback' => [ $this, 'render_empty_string' ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought, do you think it's possible to use the __return_empty_string
WP function here instead of creating a new function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test the previous changes of this PR with WordPress Playground. |
Co-authored-by: Imran Hossain <imranh920@gmail.com>
Test the previous changes of this PR with WordPress Playground. |
Part of #6351
Some blocks appeared to be untranslated in the editor. Eventually, the investigation gave us an answer: we need to register these blocks in the admin on the backend. We need to be specificn and register even those blocks that don't make much sense on the backend (as they are nested blocks).
Proposed Changes
Testing Instructions
Deprecated Code
Sensei_Block_Quiz_Question::render_quiz_question
—replaced withSensei_Block_Quiz_Question::render_empty_string
Pre-Merge Checklist