Not work hide comments with future date

The problem is you’re not using the action hook at all in the proper way. You’ll want to create date_query parameters and add this to the comment query. Here is what you can do to achieve this so that only comments created before “right now” are queried: add_action( ‘pre_get_comments’, function ( $commentQuery ) { $commentQuery->query_vars[ … Read more

How can I change the date format of the revision list?

You can filter the output like bellow: <?php /** * @param $revision_date_author * @param $revision * @param $link * @return mixed */ function filter_wp_post_revision_title_expanded( $revision_date_author, $revision, $link ) { $revision = get_post( $revision ); if ( ! $revision ) { return $revision; } if ( ! in_array( $revision->post_type, array( ‘post’, ‘page’, ‘revision’ ), true ) … Read more

Get current user last post date

Is that the only code you’ve used? As the name suggests that function returns the entire post, not just the date. You still need to actually get the date from that post. $user_id = 2; $post = get_most_recent_post_of_user( $user_id ); if ( $post ) { echo get_the_date( ‘Y-m-d’, $post ); } See the PHP documentation … Read more

Display post count for a specific month

here is correct answer if someone need $aprel = get_queried_object(); /////////////////////////////////////////////////// $aprelpost = array( ‘post_type’ => ‘sikayet’, ‘post_status’=>’publish’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘sectors’, ‘field’ => ‘slug’, ‘terms’ => $aprel->slug, ), ), ‘date_query’ => array( ‘year’ => 2021, ‘month’ => 3 ) ); $aprelpost_query = new WP_Query ( $aprelpost ); $ap … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)