Do:
add_action('save_post', 'my_save_function', 10, 2);
And the $post object
will be passed as second argument to your function:
function my_save_function($post_ID, $post) {
Related Posts:
- Stop WordPress Wrapping Images In A “P” Tag
- Keyboard shortcut for updating a page or post?
- Customizing HTML Editor Quicktags button to open a dialog for choosing insert options
- Allow user to “edit_others_posts” to save only, not publish
- Let private posts stay in status “private” after edit through “editors”
- how to limit edit_form_after_title hook to page and post edit only?
- Listen to Post action
- How to create WP Editor using javascript
- How to add editor’s name to entry meta byline?
- What to use: wp_is_post_autosave( $post_id ) or DOING_AUTOSAVE?
- Restrict access to post if it is currently being edited
- Change padding to text indent in “Increase indent” TinyMCE
- How can I allow editors to leave comments on posts that have not yet been published?
- Automatically added brs and paragraphs?
- Better post meta efficiency?
- Have save_post write to database image meta [closed]
- Get the post_id of a new post
- Custom function for “Submit for Review” hook
- add image map script to post
- Content editor creating blank paragraphs in spaces and creating   in the_excerpt
- 2nd button row from WP Super Edit or TinyMCE Advanced doesn’t show to 2nd admin
- publish_post conflicts with save_post
- Strange problems when I try to insert HTML\XML code snippet in my posts
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- Visual / HTML tabs vanished on editor
- Getting a 404 error when clicking edit page
- WordPress version 3.8 – Preview button not working for editor
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Make Post Editor Select Number of Columns To 1 By Default
- How to get post bulk edit action trigger and get edited post ids?
- Get Meta Key Value While Saving Post
- Updating post data on save (save_post vs wp_insert_post_data)
- Lost draft under all posts and drafts
- save_post hook is not called when post is saved
- WP text styles not coming through to actual post
- WordPress.com post editor replacement
- Change post author without using wp_update_post()
- Update post meta within save_post action
- Why can’t publish posts with too much text?
- Keyboard shortcut for headings on safari
- any way to access variables from within post editor?
- Save / Update meta data as multidimensional array
- Embedding Post Editor Into External Site
- Execute php after post save/update
- Contributor edits published post and sends for review – post is made private?
- Display simple html code in post
- Get Category in save_post Hook
- problem with admin panel
- How to allow some visitors to edit inline specific post
- How to custom sort-out editing-panel fields?
- Stripping tag from elements in post
- Post thumbnail is not shown in wp-admin
- How to display by default only published posts/pages in the admin area?
- Edit meta data does’t work with custom sql
- How to add an admin function only to posts, not pages?
- Unable to modify(update) posts – Page not found
- Cannot Update A Post, 404 Error
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- get_post_field – Title without paragraph
- Changing html lang depending on author
- WP_Query do not load specifed number of post
- Manually removing revision post types
- Modify WP_Post before processing
- How to rename “Publish” metabox title in post screen
- Count search results in heading
- Applying $posts_clauses filter to specific queries only
- edit_form_after_editor only in post edit pages
- Create new posts in bulk using existing post
- Problem with adding programmatically woocommerce product post into category
- Decide user that can publish a post
- How not display particular post?
- Increase 10 post limit per page
- Shortcodes on my website stops working after theme update [closed]
- Show posts by author of membership level (Paid Membership Pro)
- How can you display all sibling categories to a post?
- retrieve the oldest post id
- How can I remove the first two words and shorten get_the_title()
- how to add updated_by column to posts admin panel?
- If no posts exist for current day and month, show the next available day of posts
- Get latest post from categories
- Simple Custom Metabox Not Saving
- Access last visit time to a post
- Loop not showing first post
- Geting error in post and category [closed]
- Target only single product page
- Bulk find & replace on WordPress posts/pages (minus image paths)
- How can get the last post date of the user?
- How to convert attachment pages to Posts?
- how can i fix my display post in my index.php
- Ajax post doesnt call succes after got the response
- Adding a ‘section’ to the backend menu
- Get 5 most recent categories
- List of authors posts minus very latest
- Add category attribute to custom recent post shortcode
- How can I show my post under a certain content name?
- How to display only one post on first category page and rest on next pages?
- Show Custom Post From Logged In Author
- Is there a way to separate wordpress titles from their posts?
- custom sort posts in archive/taxanomy page
- Trying to create shortcode listing custom posts, but formating not being included