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

Allow using a custom domainpath for viewscripts #40136

Merged
merged 1 commit into from
May 4, 2022

Conversation

aristath
Copy link
Member

@aristath aristath commented Apr 7, 2022

What?

Allow using a custom domainpath for translations in view-scripts.

Why?

See discussion in #36176 (comment)

How?

Adds a new domainpath arg. The domainpath name was chooses for consistency with the Core patches on trac.

@aristath aristath requested a review from gziolo April 7, 2022 08:33
Base automatically changed from add/multiple-view-scripts to trunk April 7, 2022 10:27
@aristath aristath force-pushed the fix/viewScript-custom-domainpath branch from 6333db8 to f1df51b Compare April 14, 2022 07:32
@aristath
Copy link
Member Author

Rebased the PR and resolved conflicts now that #36176 has been merged. 👍

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Code looks great 👍

We should improve the documentation. Do we have unit tests covering this new API?

@@ -198,8 +198,9 @@ function wp_enqueue_block_view_script( $block_name, $args ) {
'ver' => false,
'in_footer' => false,

// Additional arg to allow translations for the script's textdomain.
// Additional args to allow translations for the script's textdomain.
Copy link
Member

Choose a reason for hiding this comment

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

It feels like we should update the function’s documentation to make it more clear what every param should look like.

@aristath aristath force-pushed the fix/viewScript-custom-domainpath branch from f1df51b to dbc0ab2 Compare May 3, 2022 10:06
@gziolo gziolo added the [Feature] Block API API that allows to express the block paradigm. label May 3, 2022
@aristath aristath merged commit f8854a2 into trunk May 4, 2022
@aristath aristath deleted the fix/viewScript-custom-domainpath branch May 4, 2022 05:50
@github-actions github-actions bot added this to the Gutenberg 13.2 milestone May 4, 2022
@priethor priethor added [Type] Enhancement A suggestion for improvement. Internationalization (i18n) Issues or PRs related to internationalization efforts labels May 4, 2022
@bph bph added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. Internationalization (i18n) Issues or PRs related to internationalization efforts Needs Dev Note Requires a developer note for a major WordPress release cycle [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants