Version Description
- Bug fix: Fix loading of admin page assets when removal of unregistered clients is enabled. This bug has been hiding under a rock for a while. rc11 turned over the rock, and this bug scurried out.
Download this release
Release Info
Developer | mlwilkerson |
Plugin | Font Awesome Icons |
Version | 4.0.0-rc12 |
Comparing to | |
See all releases |
Code changes from version 4.0.0-rc11 to 4.0.0-rc12
- font-awesome.php +1 -1
- includes/class-fontawesome.php +41 -20
- readme.txt +6 -1
font-awesome.php
CHANGED
@@ -7,7 +7,7 @@ use \Exception, \Error;
|
|
7 |
* Plugin Name: Font Awesome
|
8 |
* Plugin URI: https://fontawesome.com/how-to-use/on-the-web/using-with/wordpress
|
9 |
* Description: Adds Font Awesome 5 icons to your WordPress site. Supports Font Awesome Pro. Resolves conflicts across many plugins or themes that use Font Awesome.
|
10 |
-
* Version: 4.0.0-
|
11 |
* Author: Font Awesome
|
12 |
* Author URI: https://fontawesome.com/
|
13 |
* License: GPLv2 (or later)
|
7 |
* Plugin Name: Font Awesome
|
8 |
* Plugin URI: https://fontawesome.com/how-to-use/on-the-web/using-with/wordpress
|
9 |
* Description: Adds Font Awesome 5 icons to your WordPress site. Supports Font Awesome Pro. Resolves conflicts across many plugins or themes that use Font Awesome.
|
10 |
+
* Version: 4.0.0-rc12
|
11 |
* Author: Font Awesome
|
12 |
* Author URI: https://fontawesome.com/
|
13 |
* License: GPLv2 (or later)
|
includes/class-fontawesome.php
CHANGED
@@ -100,7 +100,7 @@ if ( ! class_exists( 'FortAwesome\FontAwesome' ) ) :
|
|
100 |
/**
|
101 |
* The version of this WordPress plugin.
|
102 |
*/
|
103 |
-
const PLUGIN_VERSION = '4.0.0-
|
104 |
/**
|
105 |
* The version of this plugin's REST API.
|
106 |
*
|
@@ -133,6 +133,14 @@ if ( ! class_exists( 'FortAwesome\FontAwesome' ) ) :
|
|
133 |
*/
|
134 |
const RESOURCE_HANDLE_V4SHIM = 'font-awesome-official-v4shim';
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
// phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
137 |
/**
|
138 |
* @ignore
|
@@ -226,6 +234,15 @@ if ( ! class_exists( 'FortAwesome\FontAwesome' ) ) :
|
|
226 |
/* noop */
|
227 |
}
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
/**
|
230 |
* Main entry point for running the plugin. Called automatically when the plugin is loaded. Clients should
|
231 |
* not invoke it directly.
|
@@ -537,11 +554,13 @@ if ( ! class_exists( 'FortAwesome\FontAwesome' ) ) :
|
|
537 |
<?php
|
538 |
}
|
539 |
|
540 |
-
// phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
541 |
/**
|
|
|
|
|
542 |
* @ignore
|
|
|
543 |
*/
|
544 |
-
|
545 |
$v3deprecation_warning_data = $this->get_v3deprecation_warning_data();
|
546 |
|
547 |
if ( $v3deprecation_warning_data && ! ( isset( $v3deprecation_warning_data['snooze'] ) && $v3deprecation_warning_data['snooze'] ) ) {
|
@@ -572,7 +591,7 @@ if ( ! class_exists( 'FortAwesome\FontAwesome' ) ) :
|
|
572 |
$added_wpr_object = false;
|
573 |
foreach ( $admin_asset_manifest as $key => $value ) {
|
574 |
if ( preg_match( '/\.js$/', $key ) ) {
|
575 |
-
$script_name = self::
|
576 |
// phpcs:ignore WordPress.WP.EnqueuedResourceParameters
|
577 |
wp_enqueue_script( $script_name, $asset_url_base . $value, [], null, true );
|
578 |
|
@@ -594,8 +613,12 @@ if ( ! class_exists( 'FortAwesome\FontAwesome' ) ) :
|
|
594 |
}
|
595 |
if ( preg_match( '/\.css$/', $key ) ) {
|
596 |
// phpcs:ignore WordPress.WP.EnqueuedResourceParameters
|
597 |
-
wp_enqueue_style( self::
|
598 |
}
|
|
|
|
|
|
|
|
|
599 |
$script_number++;
|
600 |
}
|
601 |
}
|
@@ -1575,21 +1598,19 @@ EOT;
|
|
1575 |
|
1576 |
foreach ( $collections as $key => $collection ) {
|
1577 |
foreach ( $collection->registered as $handle => $details ) {
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
);
|
1592 |
-
}
|
1593 |
}
|
1594 |
}
|
1595 |
}
|
100 |
/**
|
101 |
* The version of this WordPress plugin.
|
102 |
*/
|
103 |
+
const PLUGIN_VERSION = '4.0.0-rc12';
|
104 |
/**
|
105 |
* The version of this plugin's REST API.
|
106 |
*
|
133 |
*/
|
134 |
const RESOURCE_HANDLE_V4SHIM = 'font-awesome-official-v4shim';
|
135 |
|
136 |
+
/**
|
137 |
+
* The base name of the handle used for enqueuing this plugin's admin assets, those required for running
|
138 |
+
* the admin settings page.
|
139 |
+
*
|
140 |
+
* @since 4.0.0
|
141 |
+
*/
|
142 |
+
const ADMIN_RESOURCE_HANDLE = self::RESOURCE_HANDLE . '-admin';
|
143 |
+
|
144 |
// phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
145 |
/**
|
146 |
* @ignore
|
234 |
/* noop */
|
235 |
}
|
236 |
|
237 |
+
/**
|
238 |
+
* Returns this plugin's admin page's screen_id. Only valid after the admin_menu hook has run.
|
239 |
+
*
|
240 |
+
* @since 4.0.0
|
241 |
+
*/
|
242 |
+
public function admin_screen_id() {
|
243 |
+
return $this->screen_id;
|
244 |
+
}
|
245 |
+
|
246 |
/**
|
247 |
* Main entry point for running the plugin. Called automatically when the plugin is loaded. Clients should
|
248 |
* not invoke it directly.
|
554 |
<?php
|
555 |
}
|
556 |
|
|
|
557 |
/**
|
558 |
+
* This function is not part of this plugin's public API.
|
559 |
+
*
|
560 |
* @ignore
|
561 |
+
* @internal
|
562 |
*/
|
563 |
+
public function initialize_admin() {
|
564 |
$v3deprecation_warning_data = $this->get_v3deprecation_warning_data();
|
565 |
|
566 |
if ( $v3deprecation_warning_data && ! ( isset( $v3deprecation_warning_data['snooze'] ) && $v3deprecation_warning_data['snooze'] ) ) {
|
591 |
$added_wpr_object = false;
|
592 |
foreach ( $admin_asset_manifest as $key => $value ) {
|
593 |
if ( preg_match( '/\.js$/', $key ) ) {
|
594 |
+
$script_name = self::ADMIN_RESOURCE_HANDLE . '-' . $script_number;
|
595 |
// phpcs:ignore WordPress.WP.EnqueuedResourceParameters
|
596 |
wp_enqueue_script( $script_name, $asset_url_base . $value, [], null, true );
|
597 |
|
613 |
}
|
614 |
if ( preg_match( '/\.css$/', $key ) ) {
|
615 |
// phpcs:ignore WordPress.WP.EnqueuedResourceParameters
|
616 |
+
wp_enqueue_style( self::ADMIN_RESOURCE_HANDLE . '-' . $script_number, $asset_url_base . $value, [], null, 'all' );
|
617 |
}
|
618 |
+
/**
|
619 |
+
* This will increment even when there's not a match, so the sequence might be 1, 3, 5,
|
620 |
+
* instead of 1, 2, 3. That's fine--this is just for uniqueification.
|
621 |
+
*/
|
622 |
$script_number++;
|
623 |
}
|
624 |
}
|
1598 |
|
1599 |
foreach ( $collections as $key => $collection ) {
|
1600 |
foreach ( $collection->registered as $handle => $details ) {
|
1601 |
+
if ( preg_match( '/' . self::RESOURCE_HANDLE . '/', $handle )
|
1602 |
+
|| preg_match( '/' . self::RESOURCE_HANDLE . '/', $handle ) ) {
|
1603 |
+
continue;
|
1604 |
+
}
|
1605 |
+
if ( strpos( $details->src, 'fontawesome' ) || strpos( $details->src, 'font-awesome' ) ) {
|
1606 |
+
array_push(
|
1607 |
+
$this->unregistered_clients,
|
1608 |
+
array(
|
1609 |
+
'handle' => $handle,
|
1610 |
+
'type' => $key,
|
1611 |
+
'src' => $details->src,
|
1612 |
+
)
|
1613 |
+
);
|
|
|
|
|
1614 |
}
|
1615 |
}
|
1616 |
}
|
readme.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
=== Font Awesome ===
|
2 |
Contributors: fontawesome, mlwilkerson, robmadole, rachelbaker
|
3 |
-
Stable tag: 4.0.0-
|
4 |
Tags: font, awesome, fontawesome, font-awesome, icon, svg, webfont
|
5 |
Requires at least: 4.7
|
6 |
Tested up to: 5.2.2
|
@@ -186,6 +186,11 @@ Find the Font Awesome admin settings page either under the "Settings" menu on th
|
|
186 |
|
187 |
== Changelog ==
|
188 |
|
|
|
|
|
|
|
|
|
|
|
189 |
= 4.0.0-rc11 =
|
190 |
|
191 |
* Bug fix: enqueue Font Awesome assets in admin and login areas, not just in the front end
|
1 |
=== Font Awesome ===
|
2 |
Contributors: fontawesome, mlwilkerson, robmadole, rachelbaker
|
3 |
+
Stable tag: 4.0.0-rc12
|
4 |
Tags: font, awesome, fontawesome, font-awesome, icon, svg, webfont
|
5 |
Requires at least: 4.7
|
6 |
Tested up to: 5.2.2
|
186 |
|
187 |
== Changelog ==
|
188 |
|
189 |
+
= 4.0.0-rc12 =
|
190 |
+
|
191 |
+
* Bug fix: Fix loading of admin page assets when removal of unregistered clients is enabled. This bug has been
|
192 |
+
hiding under a rock for a while. rc11 turned over the rock, and this bug scurried out.
|
193 |
+
|
194 |
= 4.0.0-rc11 =
|
195 |
|
196 |
* Bug fix: enqueue Font Awesome assets in admin and login areas, not just in the front end
|