Based on your link, I modified the code to set time frame as below, but it is not working. Could you please look into it? Thanks in advance
/**
* Check if the current user can post
*
* @return bool
*/
function wpufe_can_post() {
global $post_type;
global $wpdb;
global $userdata;
$user = wp_get_current_user();
if( $post_type === 'post' ) {
$today = date( 'Y-m-d 00:00:00', ( gmmktime() ));
$news_count = $wpdb->get_var( "SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND post_author = $userdata->ID AND post_modified > '$today'" );
if( $news_count >= 1 ) {
return false;
}
return true;
}
}
/**
* Show the message if can't post
*
* @param string info message
* @return string info message
*/
function wpufe_show_message( $info ) {
if( !wpufe_can_post() ) {
$info = 'Sorry, you have exceeded the limit of post per day';
}
return $info;
}
add_filter( 'wpuf_addpost_notice', 'wpufe_show_message' );