Skip to content

Commit

Permalink
Merge pull request #19 from moderntribe/fix/update-enqueue-function
Browse files Browse the repository at this point in the history
[FIX] Update Enqueue Functions
  • Loading branch information
GeoffDusome authored Jun 6, 2023
2 parents a2f3168 + bf11a96 commit 3771eb4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
5 changes: 4 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://tri.be
Tags: blocks, editor, alignment
Requires at least: 6.0
Tested up to: 6.2
Stable tag: 1.0.4
Stable tag: 1.0.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -21,6 +21,9 @@ The plugin runs off of an `_experimentalLayout` attribute in `theme.json` that a

== Changelog ==

= 1.0.5 =
* Use `enqueue_block_editor_assets` instead of `admin_enqueue_scripts` to prevent dependency errors

= 1.0.4 =
* Use `wp_remote_get` for grabbing `theme.json` to prevent SSL errors

Expand Down
8 changes: 4 additions & 4 deletions block-editor-custom-alignments.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Plugin Name: Block Editor Custom Alignments
* Plugin URI: https://https://github.com/moderntribe/block-editor-custom-alignments
* Description: Allows developers to add custom alignments to `theme.json` for use in the block editor.
* Version: 1.0.4
* Version: 1.0.5
* Author: Modern Tribe
* Author URI: https://tri.be
* License: GPL-2.0+
Expand Down Expand Up @@ -54,7 +54,7 @@ class Block_Editor_Custom_Alignments {
public function __construct() {
global $pagenow;

$this->version = '1.0.4';
$this->version = '1.0.5';
$this->name = 'block-editor-custom-alignments';
$this->base_url = trailingslashit( plugin_dir_url( __FILE__ ) );
$this->theme_json = $this->block_editor_custom_alignments_theme_json();
Expand All @@ -66,8 +66,8 @@ public function __construct() {
$this->dependencies[] = 'wp-edit-post';
}

add_action( 'admin_enqueue_scripts', [ $this, 'block_editor_custom_alignments_admin_scripts' ], 10 );
add_action( 'admin_enqueue_scripts', [ $this, 'block_editor_custom_alignments_admin_styles' ], 10 );
add_action( 'enqueue_block_editor_assets', [ $this, 'block_editor_custom_alignments_admin_scripts' ], 10 );
add_action( 'enqueue_block_editor_assets', [ $this, 'block_editor_custom_alignments_admin_styles' ], 10 );
add_action( 'wp_enqueue_scripts', [ $this, 'block_editor_custom_alignments_public_styles' ], 10 );
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "block-editor-custom-alignments",
"version": "1.0.4",
"version": "1.0.5",
"description": "Allows developers to add custom alignments to `theme.json` for use in the block editor.",
"author": "Modern Tribe <[email protected]>",
"license": "GPL-2.0-or-later",
Expand Down
14 changes: 3 additions & 11 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,15 @@ const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
*/
const assetEntryPoints = () => {
return {
'admin': resolve(
pkg.directories.admin,
'',
'admin.js'
),
'public': resolve(
pkg.directories.public,
'',
'public.js'
)
admin: resolve( pkg.directories.admin, '', 'admin.js' ),
public: resolve( pkg.directories.public, '', 'public.js' ),
};
};

module.exports = {
...defaultConfig,
entry: {
...assetEntryPoints()
...assetEntryPoints(),
},
output: {
...defaultConfig.output,
Expand Down

0 comments on commit 3771eb4

Please sign in to comment.