Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Hello
Is it possible that in user activity the custom post types are added to the total blog articles written by a user?
Thanks
You should use this code. Put it in the functions.php file of your active WordPres theme or use the Code Snippets plugin to insert it into your website.
Don't forget to add custom post types in the $post_type = [....] array after the 'post'. Separate post types by comma, make sure you use the post type name not the post type titles. Post type names don't have upper case chars and spaces:
add_filter('get_usernumposts', 'wpforo_user_custom_post_type_count',10, 4);
function wpforo_user_custom_post_type_count( $count, $userid, $post_type, $public_only ){
$post_type = ['post']; //add comma separated custom post types['post', 'book', 'event',...]
if( function_exists('WPF') ){
global $wpdb;
if(is_wpforo_page()){
$where = get_posts_by_author_sql( $post_type, true, $userid, $public_only );
$custom_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" );
if( $custom_count ) return $custom_count;
return $count;
}
}
}