So basicly you want an ajax method that checks for post changes.
Here’s a great article on WP ajax for front & back-end.
In short you want to do the following:
- Load the Ajax JS script on the pages you want to show the
notification popup. - Create wp ajax server-side handling, with hook
wp_ajax_{your_custom_action}
. OR use the WP REST API. - Check if a post has changed etc, echo result back to ajax js script.
- If ajax response is ‘new_post’ etc show popup.
I wouldn’t use setinterval
. Do the first ajax call on page load, if the ajax response is good, do the next ajax call after X seconds.
Related Posts:
- Custom post type for ‘staff’ versus using wordpress user profiles?
- Prevent trash/delete action on specific post types
- Custom post type support for get_users(‘orderby=post_count’);
- Updating custom post meta with ajax
- WordPress post sorting with AJAX
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Front end registration/login & publish/update 1 custom post
- Prevent reload confirmation after AJAX save
- How to filter post data with AJAX on page?
- Debug whats going on inside a function called from AJAX
- User roles – enable custom posts disable posts
- Allow User to Edit Page Based on their Email
- Is there an easy way to AJAX-ify saving of post?
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- Assigning a role to a specific custom post type (and ignoring other post types)
- WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
- How to show custom post type count in the users admin page
- Show admin help message across custom post type parent and child posts
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- How to use wp_mail in CPT page
- Delete Current Author Frontend user while delete custom post type
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- WP-Admin edit.php & post.php slowdown after import of 10k users
- Ajax form filter post by custom fields [closed]
- How to load custom post archives sub-pages with ajax?
- Link users to a custom post type
- Getting the URL of the parent page
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- how to delete all users and posts based on ‘user_meta’?
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- Notify admin on new submit
- Hiding posts by other users and non-logged in
- Ajax Custom Post Filter is not filtering
- Custom post type – use ajax to display sub pages
- Send notifications to custom post author when custom post is edited
- Disable user from updating certain posts
- Dynamic Custom Fields
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Query posts based on the meta key values of logged-in users?
- How to restrict author to only access one custom post type ?
- Send notification to the admin when new custom post is submitted
- Associate multiple users to custom post type
- Load Next Posts With AJAX not working with custom post type
- Retrieve custom post types by custom taxonomies with WP_Query
- How can i display movies in profile page, added by an user?
- Load Next WordPress Posts With AJAX?
- Delete “Post Published. View Post” for custom post type
- Send a conditional email notification when a custom field value changes in Post Type
- Custom User role not working with custom post type
- admin-ajax.php GET custom-post titles
- get comments by current user inside page template
- Assign post type to many users
- Post will not load via ajax
- Select2 AJAX and WP Query Returns ALL and does not filter
- ajax response not recieving
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- Getting a GET error in console – 404 not found for wp-json
- filter by custom taxonomy using ajax
- passing values from functions.php to template
- Multiple wp_editor instances in custom post type using Ajax
- Add a custom post when inserting a new user in WordPress?
- Order users by number of posts (includes custom post type)
- Plugin needed to allow subscribers to post articles on the front end without admin approval [closed]
- Display custom-post type based on the Title matching the current selected value
- WordPress custom post type numeric pagination with ajax
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- Clone wp-admin/users.php (Users Admin Page)
- Not saving custom taxonomy while using ajax
- Search for custom field input of a custom post type in ajax live search
- How to display an admin-notice after custom post type edit modification
- Trying to list years (for a filter) but not all years display
- Attend event form with ajax
- Assign a Post to a User
- My post loop needs to have 8 different post templates
- Show ajax form resuslts in page
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Custom Post Type Query by user id
- Autofill advanced custom field with user data
- Is there a best practice, or typical way to do AJAX updating for data on a custom admin screen or post.php?
- Filtering custom post using Ajax and taxonomies, keep getting 0
- connect users to Custom post types
- Reference field of users in custom post type
- Fetch loop of custom post types with AJAX
- Calling in Post Content via AJAX
- Custom Post Hierarchy and users
- how to display notifications in the wordpress menu when a new post is published
- Creating multiple profiles under one user to assign to particular posts
- Control what custom posts a user can see
- How to load more custom type posts through AJAX & LOAD MORE POSTS button
- Updating custom post meta with ajax
- Custom filtering on month value only of an entire date field
- Check in function on custom page
- how to show Author post type count
- Internal Server Error when echoing an OBJECT from wp ajax action function in functions.php to JS file
- Load posts via AJAX without draft status
- How do I add the “orange counter” next to a Custom Post Type?