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?
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- AJAX search on post pages by custom post type
- Development of a WordPress Search Plugin – Best Practices
- Prevent trash/delete action on specific post types
- Custom post type support for get_users(‘orderby=post_count’);
- Updating custom post meta with ajax
- Favouriting a Custom Post Type
- 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
- Filtering custom posts with Ajax
- Prevent reload confirmation after AJAX save
- is_singular() not working if called via callback function of admin-ajax.php
- 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
- Admin to user notices – best practices?
- 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)?
- How can I get the last posts by user role?
- 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
- 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
- Community and User Generated Content Website: Have been thinking about Drupal but leaning on WordPress heavily
- 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
- Display custom post data in sidebar w/ dropdown
- 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
- 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?
- Assign a Post to a User
- 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
- Show ajax form resuslts in page
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Ajax load more inside custom post type taxonomy
- 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?
- 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
- Reference field of users in custom post type
- Fetch loop of custom post types with AJAX
- Collect custom post in a calendar
- Calling in Post Content via AJAX
- Custom Post Hierarchy and users
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- how to display notifications in the wordpress menu when a new post is published
- UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post
- Creating multiple profiles under one user to assign to particular posts
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Control what custom posts a user can see
- Associate custom categories to different user IDs
- BCC email to subscribers
- How to load more custom type posts through AJAX & LOAD MORE POSTS button
- Updating custom post meta with ajax
- Display and Allow users to edit their own profiles
- Custom filtering on month value only of an entire date field
- Check in function on custom page
- Two different archive pages showing the same content
- WordPress and Unity high scores table
- update custom taxonomy with Ajax in edit.php file [duplicate]
- how to show Author post type count
- How to filter custom post data with AJAX?
- 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?
- Appointment booking system in WordPress
- Issues with Ajax Pagination and Filtering
- Hide load more button if no more post in selected category
- Passing total post count to javascript
- get total post in category via ajx
- Default post showing more than intended
- 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
- Post current post type to my Ajax
- Ajax load more post button not showing