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

performance: add frontend variables only when there is a block that needs them #3019

Merged
merged 7 commits into from
Jan 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ public function register_frontend_assets() {
wp_register_script( 'ugb-block-frontend-js', null, [], STACKABLE_VERSION );
}

$args = apply_filters( 'stackable_localize_frontend_script', array(
'restUrl' => get_rest_url(),
'i18n' => array(), // Translatable labels used in the frontend should go here.
) );
$args = apply_filters( 'stackable_localize_frontend_script', array() );
wp_localize_script( 'ugb-block-frontend-js', 'stackable', $args );

// Register inline frontend styles, these are always loaded.
Expand Down