diff --git a/inc/class-widget.php b/inc/class-widget.php index 763f472..be8a169 100644 --- a/inc/class-widget.php +++ b/inc/class-widget.php @@ -39,7 +39,10 @@ final class Widget { if (!wp_script_is(self::HANDLE)) { wp_enqueue_script( self::HANDLE, - self::get_script_url() + self::get_script_url(), + args: [ + 'in_footer' => true + ] ); } @@ -49,6 +52,9 @@ final class Widget { self::get_floating_script_url(), [ self::HANDLE + ], + args: [ + 'in_footer' => true ] ); } @@ -186,6 +192,9 @@ final class Widget { Plugin::get_url('assets/floating.js'), [ self::FLOATING_HANDLE + ], + args: [ + 'in_footer' => true ] ); diff --git a/inc/location/class-post-password-form.php b/inc/location/class-post-password-form.php index 5fa5c13..c846c30 100644 --- a/inc/location/class-post-password-form.php +++ b/inc/location/class-post-password-form.php @@ -28,14 +28,14 @@ final class PostPasswordForm extends Location { #[Override] public function activate(): void { - add_filter('the_password_form', [$this, 'render_form']); + add_filter('the_password_form', [$this, 'render_form'], 10, 3); add_action('login_form_postpass', [$this, 'process_form']); } public function render_form(string $output, WP_Post $post, string $invalid_password):string { ob_start(); $this->render(); - $output .= ob_get_clean(); + $output = str_replace('', ob_get_clean() . '', $output); if (Settings::is_widget_floating()) { $output = Widget::set_button_floating($output);