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?
- Stop WP from creating “Sample Page” and “Hello World!” post
- Count how many posts in category
- Custom Single Post By Category
- Post slugs and images cannot have same name?
- Hide password protected posts in admin
- Adding Post Counts to Menu (Nav) Programmatically?
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Show chart in post using data passed as custom field
- Show One Category on Post
- Show post titles only on the homepage
- Creating new page with pre-defined parent page
- Get all Youtube video’s from posts and embed them on a different page
- Send email to user that his post has been rejected
- How can I highlight syntax like it appears on stackoverflow?
- wp_insert_post let users post to without login…broke
- Export posts manually selected by end user (not logged in)
- Add Category name to Post Title (h1)
- Blogroll – Different layout for first post
- How to delete old posts’ edits to save space?
- When trashing a post, also trash related comments
- Loop through all product posts?
- Image Insert into posts and pages not working after 3.2.1 update
- Blog Posts not showing title
- How to add Tags Filter in wordpress admin dashboard
- allow new users to post an article before they sign up [closed]
- Make Post Editor Select Number of Columns To 1 By Default
- Display post category in foreach loop with category link
- IP camera jpg stream to post
- Adding custom fields to bbpress reply form
- How To Hide A Post
- Skip in WordPress Post ID’s, can this cause issues?
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Why my wp_posts data is so huge?
- Adding a user’s ID behind the tag ref link address
- One post out of more than twenty shows odd picture (from post) in the header
- Benefits to using semantic HTML in post content? [closed]
- custom word in custom permalink structure
- Post filtering is returning blank page
- Using wp_tag_cloud with only posts published in specific year
- Display Featured Posts Grid on Static Page (Gazette)
- How to Featured content with images in home page?
- how to display today’s most viewed posts order by custom meta “views”
- Keyboard shortcut for headings on safari
- Optimal WP Web App Backend for mobile app development
- Change permalinks for posts & for custom post types
- How to customize blog post titles to render a YouTube logo on posts with an embedded video?
- Restricting displayed posts to posts from only select authors
- Updating post status via rest api
- How to Make my Homepage Display a Single Specific Post?
- unable to display two post per page in wordpress front-page.php
- WP Ajax returning 0, can’t find action
- Anchor links turn to p nbsp p
- Scheduled posts appear as clickable in the front end
- Counting Posts by Category
- show image gallery in archives or category page
- 2 Domains, Same Content, Different Titles?
- Adding wordpress posts using phpmyadmin
- Colorbox not working on native WordPress gallery when gallery is loaded thru AJAX
- Show author bio box
- How can I get post text from all posts on a WordPress news site?
- Use special template for the first post in the loop
- Fixing the WP Post Object for Custom Route
- Changing the Category for all posts of an Author
- Posting a comment redirects admin/users to blank page
- Is it possible to have dynamic post id # in add_menu_page()?
- Expired Post with More Recent Time Stamp?
- Hiding menu on mobile only when viewing posts?
- Posts don’t appear on Template Page
- Latest Posts not in the right order
- Howto put advertising as post number 1,2,3 etc
- limit posts per page
- WordPress Admin Tables in Post View
- How do I insert a custom field in a user submitted post?
- Onclick open posts displayed in slider in a popup [closed]
- Listing category and its posts one by one
- Print out one of 2 post category [closed]
- How to get if category has posts?
- Moving featured image to top of new post editor screen
- Display posts with id equal to relationship value
- Imported Posts missing summary text on staging site
- Read more opens attachment
- WP_Query post_tilte search in posts table