You are going to have to add some Javascript to the page that will check for a timeout.
Remember that PHP is executed on the server, and the servers sends HTML to the visitor’s browser. One the page is generated, the server doesn’t do anything until the next request comes from that visitor (or anyone else).
If you want something to happen after the page is generated, then you have to do something ‘client-side’. Javascript or other code will work on the client side after the server generated (and sends) the page.
Related Posts:
- Mega Menu Walker
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- How to correct schedule my event weekly with wp_schedule_event()
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- Execute a shortcode when clicking on a image
- How can update custom meta for all posts
- Is $hook a global variable in WordPress
- wrong php date()?
- Include a php file from functions.php only to homepage
- How do I fetch all comments per post via WP REST API?
- Shortcode content output but not in correct place
- How to restrict page access to logged-in users?
- How do I display a user’s previous orders as a select box option on a product?
- Handling Body class based on Template
- How to combine wordpress_logged_in cookies in one cookie?
- Two Different Links for Same Product – WooCommerce [closed]
- Automatically adding new post categories to menu
- Get post id in a function when edit/add a post
- get author_name from queried post
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Pass php dynamic variable to shortcode
- Modify custom field input data before creating a new post
- Query Pages and post excerpts dynamically
- Is there a way to conditionally check whether a WordPress post title is empty?
- Get my site session in wordpress?
- is_user_logged_in() not working in AJAX validation call
- Register a menu – Error Header
- Filtering a function’ output for a new continued function
- Shortcode to find and replace URL
- Deleting Certain terms from appearing on the front end as links
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- How to create a field in customize and show that in header.php?
- Set site title & tagline with wp.config or function.php
- Shortcode to embed Edit Account form not working
- How to make jquery count down timer function manually editable
- Hierarchical taxonomy list with modificated term links
- Add value to new attribute inside WordPress menu items
- Please show me how to use an if/else statement in combination with wp_enqueue
- If Array Values Match Another Array’s Values, Then
- iframe not showing in content on blog page
- Get user custom field value on function.php
- entire JS folder not loading in a WP theme
- Get the name of menu item with wp_nav_menu
- Else/If Statement to Display Photo Descriptions
- Count foreach and display in menu php
- PHP Output also in Child theme, but different
- Dynamically Generate Functions and Hooks
- Strip from or something better?
- Display additional page templates and a sidebar on plugin activation
- Time Delay a URL Redirect for Specific Page
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Need help for some PHP code
- Add a Metabox checkbox to the Page Edit screen of wp-admin , which only certain roles can see and Makes only certain roles able to Edit said page
- Adding HTML Code to Replace Text in PHP
- how to replace h1 entry title with h2 in category pages only
- How to unset a function from a action inside a class, that is called in another class
- Create a new account on site B with data from the purchase of site A
- Why is the current page loaded in the pop-up window and not the specified one?
- if get_post_meta is empty echo a placeholder or shortcode
- File from parent theme imported to child theme doesn’t work – any ideas?
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- PHP multiple forms, same page, isset($_POST[]) not working?
- register_block_type is not working properly
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- cURL needing to loop through all “next_page”
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- post_exists stops working in a scheduled event
- Access WP files on “server 1”, from “server 2” – using wp-load on an external website
- Where do I implement this display of User Meta Data, and how to put it in a table?
- How can I get my pagination loop to display the correct number of total pages?
- Get posts by id using shortcode
- Is it possible to replace ‘attachment’ with another word?
- How to call WordPress PHP file using external js file
- Need help with PHP functions
- Using get_theme_mod with checkbox to display content
- use system script advertising in wordpress multisite
- WordPress styling recent post
- Styling admin page rows in order of importance (checkboxes)
- Insert wordpress tags below posts via functions.php
- Help with my first Metabox helper class
- Break a WordPress function to run in patches and re-continue
- Pagenav Not appearing on custom Template
- ISOTOPE – Missing/Invalid Arguement Get Terms
- My title is showing after the shortcode
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- Adding multiple conditional tags in a function?
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- Automatically change insurance quantity based on cart total [closed]
- hiddenQuestions.find is not a function