You’re treating $my_post as an array, and then an object. Try moving ‘edit_date’ into the array.
Also keep in mind that ‘post_date’ should be in your blog’s timezone. date will give the date-time in UTC timezone. See date_i18n() (codex: http://codex.wordpress.org/Function_Reference/date_i18n).
From what I can see, everything else is corret.
Related Posts:
- Connection lost. Saving has been disabled… (Updating Posts/Pages)
- Post/Page Publish/Update button not clickable once I make an edit
- How to batch update post content with custom post meta value
- Updating a post without escaping ampersands?
- Update post date on every new comment?
- Mass Update lines of code for all posts
- Unable to modify(update) posts – Page not found
- How do I batch create revisions of all posts?
- If modified on same day, show only time
- wp_update_post creating revisions instead of updating the post
- Can’t update WordPress Page if post_content is Empty
- Bulk update published posts date randomly using wp-cli?
- Run a function when a custom post is update?
- wp_trash_post() duplicates post to trash
- Set a post expiration and delete a post when expirate
- Bulk Post update_post_meta
- Update Post with Modified Data
- How can I use wp_after_insert_post with $current_screen?
- Implementing Soft Delete for Bulk Actions / Empty Trash
- Copy post to separate database with “add_action(….)”
- How to create a template for Pages?
- Do all wordpress themes a similar class name for content?
- Display Notification Bar on Header on Certain Post Count
- How do I do a page break?
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Add a variable in a post
- Loop parent terms {display posts} AND loop child terms {display posts}
- Print out last 3 blogposts
- Is there a query string for edit.php to show all posts that have no custom taxonomy terms?
- On what hook can I get the queried object’s final state?
- Is it possible to add a shortcode below post title?
- Edit the post title from the frontend
- Edit post locked notification dialog on edit post screen (post.php)… hook maybe?
- wp_posts table extremely large
- Image behind the post’s title
- Get the most recently modified post date of most recently modified post
- Only allow posts with a specific term to only be viewed by other authors with the same term in their post
- Queries take 120+ seconds on my large WordPress site
- Modify this line to give alternate format date?
- How to limit author related post listing ?
- Get all custom posts with a certain taxonomy
- How do I display the post_title with get_permalink?
- inserting a category into post
- Limiting the amount of posts retrieved by the loop
- Getting posts from some categories plus some individual posts
- Change layout of post depending on category
- Insert specific information to a posts of a predefined category
- How can I get posts from 9/13/11 to today with SQL? [closed]
- Direct some posts to only appear on a specific page
- How can I globally italicize list of texts in the UI database or Posts? [closed]
- How To import post If I have only subscriber access
- Get post publishing date from within custom HTML block
- Adding Text after Post Title based on Category using IF Condition – But not for menu items
- Updates are not showing to public (New Posts , Theme Change)
- How to bulk Update URLs to new values?
- How can I make a post sub link?
- Display image gallery if more than 1 image
- How do you change the permalink for posts for a single category?
- get_next_post() not working with future post status
- post thumbnails error
- Excluding category from post navigation in WordPress?
- Add another feature image box
- Show post published live
- how i show manual data in a post
- Change archive results based on GET request
- Let Contributors Review only (Not Publish) Others Posts
- How to get meta data from custom category name
- Querying posts from current category, using a variable as array argument
- How to show view all posts from front page?
- Ajax the create and edit post form into lightbox and get results
- Wp_query loop is not working as it should
- Blank page after changing number of post displayed in wp-admin
- Precedence of page permalinks over woocommerce product category links?
- Need help writing loop to display posts by categories in separate divs
- How to create a Top 10 Popular Posts Page?
- Related posts not working in the index
- Add category selection to function request
- Multiple Post Repeat for Related Post Loop by Category
- Correcting the content width when sidebar is inactive?
- How to show only Post titles on category pages
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- 2nd post different layout
- Print all content of a paged post
- 404 error on every post and page other than home
- Successive creation of over 1000 posts causes 404?
- Show last post of employee in his profile page
- Category pages vs single post pages
- How to limit post query to only return a total count of items with certain post statuses?
- Redirect posts to sub domain except pages
- How to disable edit post option? [closed]
- How do we display a certain category type on a page while hiding all others?
- How to make posts appear under pages
- How to display only introtext?
- Action while post is being published
- Default post type doesn’t display in url
- Do anything on post_status change [duplicate]
- Post page still linked to old site
- Permalink structure for two separate blogs
- Header and Footer options in pages and posts
- Allow users to edit post without logging in