Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function posts_per_day_by_authorid( $userid, $post_type, $year, $month, $day ) {
- $query = new WP_Query( array(
- 'author' => $userid,
- 'post_type' => $post_type,
- 'date_query' => array(
- array(
- 'year' => $year,
- 'month' => $month,
- 'day' => $day,
- ),
- ),
- 'posts_per_page' => -1,
- ));
- $count = $query->post_count;
- return $count;
- }
- echo posts_per_day_by_authorid( '1', 'post', '2018', '12', '13' );
- <?php
- $path = $_SERVER['DOCUMENT_ROOT'];
- require_once $path . '/wp-load.php';
- global $wpdb;
- function posts_per_day_by_authorid( $userid, $post_type, $year, $month, $day ) {
- $query = new WP_Query( array(
- 'author' => $userid,
- 'post_type' => $post_type,
- 'date_query' => array(
- array(
- 'year' => $year,
- 'month' => $month,
- 'day' => $day,
- ),
- ),
- 'posts_per_page' => -1,
- ));
- $count = $query->post_count;
- return $count;
- }
- echo posts_per_day_by_authorid( '1', 'post', '2018', '12', '13' );
- ?>
Add Comment
Please, Sign In to add comment