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:
- AJAX search on post pages by custom post type
- Custom post type support for get_users(‘orderby=post_count’);
- Updating custom post meta with ajax
- WordPress post sorting with AJAX
- Front end registration/login & publish/update 1 custom post
- Filtering custom posts with Ajax
- Prevent reload confirmation after AJAX save
- Debug whats going on inside a function called from AJAX
- User roles – enable custom posts disable posts
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- Assigning a role to a specific custom post type (and ignoring other post types)
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- 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]
- Community and User Generated Content Website: Have been thinking about Drupal but leaning on WordPress heavily
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- WP-Admin edit.php & post.php slowdown after import of 10k users
- 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’?
- Received nothing after executing AJAX post function
- 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
- Loading custom content type from ajax results?
- Is using taxonomies the way to go here or would custom post types be better?
- Hiding posts by other users and non-logged in
- Ajax Custom Post Filter is not filtering
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Send notifications to custom post author when custom post is edited
- Disable user from updating certain posts
- Load Custom_post_type categories post with ajax
- 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 assign permissions for a CPT to a user
- Load Next Posts With AJAX not working with custom post type
- $post not working working in AJAX plugin with custom post type
- comment_notification_text filter for custom post type
- Load Next WordPress Posts With AJAX?
- Custom post type’s extra fields – how to handle?
- Delete “Post Published. View Post” for custom post type
- Send a conditional email notification when a custom field value changes in Post Type
- Getting 400 Bad Request on AJAX Call
- how to associate several authors to a custom post type
- Check if user has comment on current post
- Query within a foreach within a query (queryception)
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- WordPress notification if new post published
- filter by custom taxonomy using ajax
- passing values from functions.php to template
- Send email messages after comment was submitted
- How do I update_post_meta() or add_post_meta() with an AJAX call
- Preventing role reading others posts
- Order users by number of posts (includes custom post type)
- Change Post Meta via AJAX from the posts list table
- Display custom post front end filter by ACF equals current user
- users post count
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- Clone wp-admin/users.php (Users Admin Page)
- WP_Insert_Post creating duplicate posts when logged in
- How to filter custom post type by multiple Taxonomies
- Link custom post type to users membership
- Show all post type posts in manage users posts column
- Filtering posts based on three taxonomies
- WordPress next post by ajax call on button click
- Use a template for a specific url slug without creating a page
- How to submit the date with ajax?
- Limit 1 post by user in each custom post type
- How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?
- Attend event form with ajax
- Get all of a user’s posts (custom post type) then get cumulative value of a specific meta_key value from those posts
- WordPress custom post type post item data – show/fetch only on click with Javascript dynamically?
- How to display custom post type pagination buttons when processing AJAX request
- Add WordPress users to a custom post type
- My post loop needs to have 8 different post templates
- Ajax load more inside custom post type taxonomy
- Custom Post Type Query by user id
- How to check if a new private custom post type is created?
- Filtering custom post using Ajax and taxonomies, keep getting 0
- connect users to Custom post types
- Collect custom post in a calendar
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Associate custom categories to different user IDs
- BCC email to subscribers
- Display and Allow users to edit their own profiles
- Two different archive pages showing the same content
- WordPress and Unity high scores table
- update custom taxonomy with Ajax in edit.php file [duplicate]
- 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
- Issues with Ajax Pagination and Filtering
- get total post in category via ajx
- Load more post with AJAX
- Get current post type within functions.php
- Search and filter terms of a custom post type only and display results