WordPress action hook · part of WordPress core

edit_post

A WordPress core action that 22 plugins also fire themselves, running on 1.3M+ sites between them.

“This action is documented in wp-includes/post.php”

How to use edit_post

It's an action: your callback runs at that point and receives 2 arguments. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'edit_post', function( $ID, $post ) {
	// Your code runs here.
}, 10, 2 );

Argument names come from Page Builder by SiteOrigin's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

22 plugins that fire edit_post

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Smart Slider 3 icon Smart Slider 3800,000+ installs do_action( 'edit_post', $postID, $post ) Nextend/SmartSlider3/Application/Helper/HelperSliderChanged.php:104
  2. Page Builder by SiteOrigin icon Page Builder by SiteOrigin400,000+ installs do_action( 'edit_post', $post->ID, $post ) inc/admin.php:1277
  3. BEAR icon BEAR30,000+ installs do_action( 'edit_post', $product_id, $pp ) classes/models/products.php:858
  4. Editorial Calendar icon Editorial Calendar20,000+ installs do_action( 'edit_post', $edcal_postid, $post ) edcal.php:1354
  5. Bulky icon Bulky10,000+ installs do_action( 'edit_post', $product_id, $pp ) admin/ajax.php:416
  6. Admin Management Xtended icon Admin Management Xtended5,000+ installs do_action( 'edit_post', $postid, $post ) admin-management-xtended.php:178
  7. WOLF icon WOLF4,000+ installs do_action( 'edit_post', $post_id, $pp ) classes/models/posts.php:372
  8. Seamless Donations is Sunset icon Seamless Donations is Sunset2,000+ installs do_action( 'edit_post', $post_ID, $post ) inc/utilities.php:1749
  9. BrikPanel: WooCommerce Dashboard & Analytics, Abandoned Cart Recovery, Order Export, Inventory Management & Bulk Editor icon BrikPanel: WooCommerce Dashboard & Analytics, Abandoned Cart Recovery, Order Export, Inventory Management & Bulk Editor1,000+ installs do_action( 'edit_post', $saved_id, $post_obj ) front-end/products/brikpanel-product-editor.php:10708
  10. Expiring Posts icon Expiring Posts1,000+ installs do_action( 'edit_post', $post->ID, $post ) expiring-posts.php:410
  11. Syndication Links icon Syndication Links400+ installs do_action( 'edit_post', $post_id, $post ) includes/webmentions/class-synprovider-webmention.php:103
  12. WordLift icon WordLift300+ installs do_action( 'edit_post', $post->ID, $post ) admin/wordlift-admin-save-post.php:98
  13. MEGA AI icon MEGA AI200+ installs do_action( 'edit_post', $post_id, $post_after ) mega.php:8891
  14. Live Blogging icon Live Blogging100+ installs do_action( 'edit_post', $parent_post_id, $parent_post ) live-blogging.php:821
  15. ContentGecko Connector icon ContentGecko Connector60+ installs do_action( 'edit_post', $post_id, $post ) includes/services/class-cg-post-service.php:824
  16. Live Blogging Plus icon Live Blogging Plus50+ installs do_action( 'edit_post', $parent_post_id, $parent_post ) live-blogging-plus.php:827
  17. Depublish Posts icon Depublish Posts30+ installs do_action( 'edit_post', $post->ID, $post ) src/Post.php:87
  18. Post ID Optimizer icon Post ID Optimizer10+ installs do_action( 'edit_post', $post_ID, $post ) post-poidopt.php:3918
  19. Dynamic Functionalities icon Dynamic Functionalities10+ installs do_action( 'edit_post', $post_id, $after ) includes/features/class-link-health-editor.php:237
  20. CRAI Content Updater icon CRAI Content UpdaterFewer than 10 installs do_action( 'edit_post', $original_id, $updated_post ) includes/class-crai-updater.php:1366
  21. Sidcraft Page Builder w/ AI MCP icon Sidcraft Page Builder w/ AI MCPFewer than 10 installs do_action( 'edit_post', $post_id, $post ) includes/compatibility/class-cache.php:41
  22. PerfLocale icon PerfLocaleFewer than 10 installs do_action( 'edit_post', $post_id, $after ) src/Translation/PostSlugCheck.php:135

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.