wp_update_post
expects ‘ID’ to be a single post ID, not an array. You will need to handle each post separately.
Try:
$post_ids = array( 1235, 1234, 1228, 1221, 1211, 1212, 1208, 1200 );
foreach($post_ids as $post_id) {
$post = array( 'ID' => $post_id, 'post_status' => 'pending' );
wp_update_post($post);
}
Related Posts:
- Print Current Post Index number within Loop
- Front-End Post Submission
- How To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts
- How to manually link posts to each other in WordPress
- Post/Page Publish/Update button not clickable once I make an edit
- How do I create a link that will always show the latest post?
- Get title of post without using the_title();
- How to display posts by current user/author in a custom page template?
- Display all search results
- $post->ID not working
- featuring old articles without messing up with the archive
- Add default content to post (for specific category)
- Setting pagination for images attached to a post
- Is there a plugin that creates a WP post based on a Twitter account’s hashtag?
- blog page showing only first post
- Is it possible to show a different WP menu when using password protected pages?
- Human Time Diff, change mins to minutes
- POST from jQuery to PHP
- get_post_custom stripping styling issue
- Including text at the end of every post
- same template for multiple custom post type single
- Redirect before post page
- Fetch posts from current week (Sunday to Saturday)
- Using radio button meta data from a custom meta box
- Display the Content of a Post with qTip2
- Scheduled posting not working
- Converting multiple loops into one single loop with pagination
- How to set post expiration date and time and move the page to archive after expiration [closed]
- .current-menu-item class on custom post type children pages – again?
- Get posts by multiple ID’s (query)
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Add a class to post title if a link ends with a certain extension
- Admin Notices don’t display on the admin screen for certain post
- Theme removed “Edit Post” link on the front end. I wish it back
- Custom WP_Query with complex ‘post_status’ argument
- Saving category to a post, before publishing the post
- is there a way to show the the post title after the image?
- Add the description field on the attached media
- Is there a way to notify specific users when new posts are published to specific pages?
- get_adjacent_post by language
- Force authors to Preview a post before publishing
- Bulk delete WordPress posts with phpMyAdmin
- While loop articles – if statement order
- Count number of posts of current month
- Let both the admin and post author update comment meta
- Post Image not displaying in category view
- WordPress Query Posts From Category Post on Static Page
- Edit multiple custom post types while saving a new or edited post
- Is it possible to lock all new and existing WordPress posts to one specific author?
- How to allow multiple thumbnail upload for Posts?
- Loop through posts? Want to remove extra newlines in actual post HTML/content on backend
- add external project to web site wordpress on production
- How to remove text and retain in caption image using the_content function
- How does WP decide how to display a page
- Cannot implement byline into posts container in single.php
- Showing recent post of category in page
- alternative to wp_link_pages() that only shows link to last page
- How to exclude the word “class” from being matched in search?
- Count user posts and store the number for later use
- How do I allow certain users to make a certain type of post?
- Link to older links
- WordPress Excerpt Paragraph Limiting
- display jumps to the bottom, dosnt start at the top?
- How to determine if a post was last edited in the Visual Editor
- How to limit post (Exception pages) for current user in each role in front end?
- “Blog pages show at most” in setting not working
- My page shows some other content in WP
- WordPress get tags in “publish_post” hook
- What permissions does a role need for the user to be assigned as the author of a post?
- Countrywise Post View
- Scrollbar disappear in post window
- call to jquery ajax failing with 500 error when passing extra data field
- How to create a button to filter posts (list) by meta value
- Enable HTML Tags in WordPress Post excerpt
- Checking if a post contains an html tag
- How to make certain posts not appear on the main page, but instead only a newly created category(in the menu section)
- If taxonomy has more than 6 posts, display show all
- Double loop output
- AJAX load more posts not using correct category and repeating the same few posts
- post->ID displays the same ID number for every post
- Compare date of user’s last posts
- Only get post_id [duplicate]
- Disable `create_post` for built-in post type
- how to create other sizes of original image in one go wordpress uploads
- Post are not showing up
- Difficulty in creating and handling a complex post type
- Display only current page -> posts tags in page
- Can’t seem to replicate permalink structure for localhost development site
- Newly created category does not show category
- Special Query: Title, Terms, Content – %LIKE%
- Authors can edit all posts, except when an owner is specified?
- Formatting error while publishing theblog from Microsoft Word
- Create post from form with image
- WordPress 3.2 – Problem with WYSIWYG editors in a custom post type?
- WordPress Custom Theme: My site shows the same posts on Page 1 and Page 2 and so on [duplicate]
- How to display my categories in a list (to a post, not the sidebar)?
- WordPress post enumeration
- Undefined Function Fatal Error with Shortcode [closed]
- I have a website issue I am trying to resolve
- How to sort posts alphabetically based on a specific parent category