You can use the $WPDB query to query the DB, an example would be:
$editedposts = $wpdb->get_results(
"
SELECT ID, post_title
FROM $wpdb->posts
WHERE post_modified = between DateAdd(DD,-7,GETDATE() ) and GETDATE()
"
);
This lists all posts which have been edited in the last 7 days (not tested), you would do something similar to get posts created in that date:
$newposts = $wpdb->get_results(
"
SELECT ID, post_title
FROM $wpdb->posts
WHERE post_date = between DateAdd(DD,-7,GETDATE() ) and GETDATE()
"
);
You can then query the data using the variable e.g.
foreach ( $editedposts as $newposts ) {
echo $newposts->post_title;
}
Related Posts:
- Update post counts (published, draft, unattached) in admin interface
- How to display by default only published posts/pages in the admin area?
- disable password protected page for logged users
- disable column on post and user list
- How to detect when admin user is on the All Posts page?
- I don’t want the complete article to show on homepage
- Put page on Archived statut after end of publication date
- Hide Admin posts & pages in Dashboard
- Allow users to create their own page/s
- Determine if page is the Posts Page
- Get the Current Page Number
- How to remove a column from the Posts page
- Stop WP from creating “Sample Page” and “Hello World!” post
- Keyboard shortcut for updating a page or post?
- Apply the_title() filter in post & page title, but not in menu title
- Get current menu_order
- Difference between an archive and a page listing posts
- Delete Associated Media Upon Page Deletion
- Set Default Listing “View” in Admin
- How to Display a List of Users Who Have Made at Least 1 Post?
- The next_posts_link() works only with original $wp_query
- display all posts in wordpress admin
- Get content from one page and show it on another page
- How to Check if a Page Exists by URL?
- Find out who deleted a page or post?
- Connection lost. Saving has been disabled… (Updating Posts/Pages)
- get_children() Not Working with orderby Parameter
- how to limit edit_form_after_title hook to page and post edit only?
- Using single.php from plugin folder instead of default template folder
- Post/Page Publish/Update button not clickable once I make an edit
- Sends out email to admin
- Strategy for handling hierarchical pages with empty parent content
- Can I force a metabox to be in one column?
- Skipping first 3 posts in wp query
- Custom Field in Featured image for A particular post
- How to add a new tab to page editor
- Add a new post status in the post progression
- Help! Turn php link data into url OR hide edit link in post admin OR hide drafts for all users except admin?
- How to display the page title/content in the Posts page?
- WordPress: How to get the current logged in author page URL?
- Modifying admin sidebar contents to show pending posts indicator
- Callback for wp.autosave.server.triggerSave();
- How can I see a list of pages and post where my custom Gutenberg block is used?
- Restore contents of deleted user
- How to change post to page
- RSS for Pages Instead of Posts?
- Any way to create a revision of a post ONLY with a new button in the Meta Box?
- using slug instead of ID in admin edit post url
- Display posts by tag on page
- How to Load Scripts and CSS for Admins Only When Editing or Adding Posts
- Add “Post Options” for new wordpress post
- Why do I need to use The Loop on pages (inside page.php etc)?
- What is the difference between “post” and “page” in WordPress?
- Force “Submit to review” when a post is updated
- Create custom page in WooCommerce
- posts page – different lengths of excerpt
- WordPress automatic and permanent page
- Post Admin – Filter by posts without tags
- Is there a WordPress equivalent to MediaWiki templates
- Determining Slug Before and After Edit
- Add javascript when post is published
- Getting an alphabetic post list with two letters onclick on letter
- Automatically create pages in a post based on number of words
- Static posts page with home.php
- Why does the_date work in the first custom column, but not in the second, in a series of customized Posts columns?
- Change WordPress post-state in Admin Area
- Add link on the top menu of the post table?
- Pagination not working on Custom Page Template
- Add a special filter link to All Posts in admin
- which action to hook to in order to perform post-publish action
- Set number of article per number of page
- Pagination for Pages and Posts
- Make “Post published. View post” Open in a New Tab
- Is it possible to show a different WP menu when using password protected pages?
- Can I change a post to a page by changing it’s type?
- Navigation link to specific user page
- Hiding by default specific post status on backend list?
- how to show all post in my page-grid.php template page
- eBooks download website, page or post?
- Multiple loops in same page, without duplicate content
- Get how many days since last post of the current user
- Custom colors for post rows based on post meta value
- How to add an admin function only to posts, not pages?
- prevent showing posts of an specific category in admin posts section
- Add a custom option to a page in backend
- Include related posts on a page
- why does HTML Tag not working in Post and Page
- Hide comments awaiting moderation from user who submitted the comments
- Creating new page with pre-defined parent page
- Remove whitespace at the end of posts?
- Allow role to delete posts but block him the wp-admin
- problem to delete page
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- Populating a page with content from post custom fields
- Is there a way to change the color of a row in Post Administration based on the type of post?
- Query All users that has post
- Add filter-by-tag in the all posts admin console page
- Can I hide a specific post from latest posts page?
- Hide add new page button
- Edit menu item title from edit page/post