Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRegister scripts before being enqueued #356
Conversation
|
This looks great, thank you! |
| @@ -130,6 +114,23 @@ public function get_label() { | |||
| * @since 0.1-dev | |||
| */ | |||
| public function login_enqueue_assets() { | |||
|
|
|||
| wp_register_script( | |||
| 'fido-u2f-api', | |||
This comment has been minimized.
This comment has been minimized.
kasparsd
May 13, 2020
Collaborator
Looks like this is also referenced here:
two-factor/providers/class.two-factor-fido-u2f-admin.php
Lines 75 to 81 in 2b4ce5c
so we need to make sure this script is registered before it is enqueued there.
This comment has been minimized.
This comment has been minimized.
cojennin
May 13, 2020
•
Author
Ah yea, made a change to the PR to register on admin_enqueue_scripts with a lower priority to make sure it gets registered prior to this. But when does login_enqueue_assets get called?
7f2f616
to
de6d035
rinatkhaziev
commented
Jun 17, 2020
|
Hi @kasparsd , Any plans to get this merged in the next release? |
|
Fixes #361. |
|
There appear to be a few code style issues reported here https://travis-ci.com/github/WordPress/two-factor/jobs/333298974 and a merge conflict with the latest changes introduced by the latest worked merged into Is it OK if I open a new pull request to fix these and also make sure the scripts are available on the login screen? |
|
Replacing this with #368 if that's OK. @rinatkhaziev, @cojennin Could you please code review #368? |


Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

cojennin commentedMay 13, 2020
•
edited
Registering the
fido-u2f-apiandfido-u2f-loginscripts in the__constructoris generating the following notice:Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks.It seems like these
wp_register_scriptcalls should be moved tologin_enqueue_assetsas that's where they're utilized.(Props @scottnelle for tracking this down)