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

BBT-7 Convert css vars to hex value #14

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 19 additions & 0 deletions inc/class-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Big_Bite\themer;

use WP_Block_Editor_Context;

/**
* Loader for handling assets.
*/
Expand All @@ -22,6 +24,15 @@ public function __construct() {
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_themer_assets' ), 1 );
}

/**
* Get the editor settings
*/
public function get_themer_editor_settings() {
$block_editor_context = new WP_Block_Editor_Context( array() );

return get_block_editor_settings( array(), $block_editor_context );
}

/**
* Enqueue any required assets for the themer plugin.
*
Expand All @@ -47,6 +58,14 @@ public function enqueue_themer_assets() : void {
array(),
$asset_file['version']
);

wp_localize_script(
self::SCRIPT_NAME,
'themerPlugin',
array(
'editor_settings' => $this->get_themer_editor_settings(),
)
);
}
}

Expand Down
Loading