Skip to content

Commit 2596c8e

Browse files
xecdevxecdev
andauthored
load sticky header faster (#103)
* load sticky header faster * responding to the bot's feedback --------- Co-authored-by: xecdev <ecashinformer@gmail.com>
1 parent d4bd4f1 commit 2596c8e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

assets/js/paybutton-paywall-cashtab-login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function renderLoginPaybutton() {
120120
});
121121
}
122122

123-
window.addEventListener('load', function() {
123+
jQuery(function ($) {
124124
if (!parseInt(PaywallAjax.isUserLoggedIn)) {
125125
renderLoginPaybutton();
126126
} else {

includes/class-paybutton-public.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PayButton_Public {
2525

2626
public function __construct() {
2727
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_public_assets' ) );
28-
add_action( 'wp_body_open', array( $this, 'output_sticky_header' ) );
28+
add_action( 'wp_body_open', array( $this, 'output_sticky_header' ), 5 );
2929
add_shortcode( 'paywalled_content', array( $this, 'paybutton_paywall_shortcode' ) );
3030
add_shortcode( 'paybutton_profile', array( $this, 'profile_shortcode' ) );
3131
add_shortcode( 'paybutton', [ $this, 'paybutton_generator_shortcode' ] );

0 commit comments

Comments
 (0)