add below action in your main function file of your plugin
add_action( 'wp_insert_post', 'my_project_updated_post', 10, 3 );
function my_project_updated_post( $post_id, $post, $update ) {
// your code goes here
// Every time you will get updated or newly created post id here.
}
Related Posts:
- Is get_option() faster than accessing get_transient()?
- Best practices for using the transients API
- Trouble with Transient API when W3TC is activated [closed]
- How to make dynamically-generated content searchable in WordPress?
- How can I free up the memory used by update_post_meta?
- How can I render shortcode so that its not cached by Caching plugins?
- Does WordPress’s HTTP API use any caching?
- Will cron job run if page loaded is being served from cache?
- Is using WP Transients to save external data for a plugin the best/right way?
- Cache directory needed for plugin
- Clearing cached plugin data if it is using an external object cache
- Make WordPress cache permanent for some pages until edited
- Will setcookie work if there is a cache plugin installed?
- Maximum lifetime for nonce
- Clearing caches on plugin uninstall
- How to implement filesystem cache in WordPress
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- Caching the_content calls
- Service Worker Uncaught (in promise) DOMException
- Should I use wp-content/cache or [PLUGIN_DIR]/cache?
- I need to refresh page to display wp_get_current_user() : why?
- Undefined cache functions in my custom plugin
- Is it possible to restore an expired transient?
- Plugin files not updated (cache cleared)
- Does WP REST API cache internally executed (rest_do_request) requests?
- Plugin Form Submission Best Practice
- Plugin directory “Last Updated” not changed after initial commit?
- What is the recommended way to create plugin administration forms?
- Fatal error: Call to undefined function wp_mail()
- Does WordPress have an Browser Agent?
- How Do I Load My Action Earlier Enough?
- How to check WordPress website username and password is correct
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- Filter on the_content ignores shortcodes
- Custom theme sufficient or custom plugin neccessary for this feature set?
- Check spam in custom form – akismet
- get plugin directory url
- WordPress cron running twice
- PHP library that can merge stylesheet with inline style [closed]
- admin_notices not displaying in plugin
- How to disable reCaptcha v3 except on Contact Form 7 pages?
- How to get color name in PanelColorSettings in custom Gutenberg block?
- Get Objects While Deleting term
- Fetching the value of forms in WordPress AJAX
- Cannot redeclare function error on the same line
- Write to / remove from default .htaccess file from plugin?
- js/css updating when making a plugin
- Append country to ‘pretty’ url but serve same page
- Adding a brand column to WooCommerce Products
- Custom GET Parameters In Plugin’s Admin Page
- Adding option to Gallery shortcode
- WordPress Search filter to remove possible script injections
- Plugin menu addition in multisite
- Mixing and Matching – Custom templates in a WordPress plugin
- Open Graph Object Debugger & url parameters – Page Not Found result
- How to get Metabox custom field to show checked if value is updated using post meta query?
- How to Move the Comments Bubble to the Right Side of the Toolbar
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Can’t find where to modify attrbitutes
- How to pull user/author profile data in a plugin?
- Add Password Generator on password protected page
- WordPress pages are not published due to External database connection with WPDB class
- How to optimize multiple insert into wordpress database
- How to add custom options for plugin into the add post screen – like yoast seo
- How to find where an object first instantiatiation
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- How to get terms for taxonomy
- If $var is empty, return 404.
- Listing wordpress users with a search function
- Adjust query on single
- Plugin won’t activate
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Custom Path for a Plugin
- Plugin could not be activated because it triggered a fatal error?
- Get cat parameter from admin-ajax
- How to determine primary editor for a page/post
- Using wp_mail to send email?
- WPGut – Updating failed and shortcode?
- Limit get_next_post to posts from the same author
- how to create a shortcode from a variable in plugin
- Any way, hook to add content right before the “read more” link?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- How do I ensure I can loop through every enqueued script and CSS?
- WordPress use template
- Adding body class in author page for custom role
- TinyMCE 4.7.11 – Enable hidden WordPress core plugins? (referencing a wp-includes from plugin.php)
- Enqueue scripts based on site.
- My enqueue admin style function doesn’t work because of ?=ver
- WordPress filter custom posts by multi terms of of a taxonomy
- Query only title/field/featured media of posts [closed]
- To remove rendering of menus and header, plugin or theme?
- How can I give access to my plugin sections in admin?
- Displaying External Data – Not Posts
- Making plugin output customizable
- Return all roles, including custom roles
- Mapping multiple URLs to same page
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- How to get locale within WP REST Request?
- How to add extra EXIF data when images are uploaded?
- How to boost WP custom post REST API GET queries by custom taxonomies