Skip to content

Commit

Permalink
Merge branch 'release/v1.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
wpmark committed Feb 22, 2023
2 parents abf1010 + 085f876 commit 8219d88
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
39 changes: 15 additions & 24 deletions better-core-video-embeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Description: A plugin which enhances the core video embeds for Youtube and Vimeo videos by not loading unnecessary scripts until they are needed.
Requires at least: 6.0
Requires PHP: 7.0
Version: 1.1.3
Version: 1.1.4
Author: Highrise Digital
Author URI: https://highrise.digital/
License: GPL-2.0-or-later
Expand All @@ -30,23 +30,19 @@ function hd_bcve_plugins_loaded() {
add_action( 'plugins_loaded', 'hd_bcve_plugins_loaded' );

/**
* Enqueus the frontend JS for the plugin.
* Enqueues the frontend JS for the plugin.
*/
function hd_bcve_enqueue_scripts() {

// only if the page has a core embed block present.
if ( has_block( 'core/embed' ) ) {
// enqueue the front end script to invoking the video embed on image click.
wp_enqueue_script(
'better-core-video-embeds-js',
HD_BCVE_LOCATION_URL . '/assets/js/better-core-video-embeds.min.js',
false,
false,
true
);

// enqueue the front end script to invoking the video embed on image click.
wp_enqueue_script(
'better-core-video-embeds-js',
HD_BCVE_LOCATION_URL . '/assets/js/better-core-video-embeds.min.js',
false,
false,
true
);

}
}

add_action( 'wp_enqueue_scripts', 'hd_bcve_enqueue_scripts' );
Expand All @@ -56,16 +52,11 @@ function hd_bcve_enqueue_scripts() {
*/
function hd_bcve_register_block_style() {

// only if the page has a core embed block present.
if ( has_block( 'core/embed' ) ) {

// register the style for this block.
wp_enqueue_style(
'better-core-video-embeds-styles',
HD_BCVE_LOCATION_URL . '/assets/css/better-core-video-embeds.min.css'
);

}
// register the style for this block.
wp_enqueue_style(
'better-core-video-embeds-styles',
HD_BCVE_LOCATION_URL . '/assets/css/better-core-video-embeds.min.css'
);

}

Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ The plugin provides progressive enhancement, therefore if you no longer use this

== Changelog ==

= 1.1.4 (22/02/2023) =
* Load the CSS and JS on all pages. Fixes problems when post content is output on templates such as archives. Found when using full site editing and the query block.

= 1.1.3 (21/01/2023) =
* Ensure the plugin works on videos embedded from the www or no www version of a domain e.g. www.youtube.com and youtube.com.
* Output an alt attribute on the video thumbnail image.
Expand Down

0 comments on commit 8219d88

Please sign in to comment.