$user_id,'post_type'=>'post','order'=>'DESC' ) ); //For get Post ifo
$post_count = $count_query->post_count;
$comment_count = $count_query->comment_count;
$post_query = new WP_Query( array( 'author' => $user_id,'post_type'=>'post','order'=>'DESC','showposts' => 5 ) );
?>
posts);
//echo 'This is a Test Widget
';
}
function btb_users_social_info_adding($userSocial){
$userSocial['skype'] = __('Skype Username','bootstrap-blank');
$userSocial['twitter'] = __('Twitter Username','bootstrap-blank');
$userSocial['fb'] = __('Facebook Username','bootstrap-blank');
$userSocial['linkedin'] = __('LinkedIn Profile Link','bootstrap-blank');
return $userSocial;
}
add_filter('user_contactmethods','btb_users_social_info_adding');
/*Add admin css in admin_head */
function btb_add_eneque_script(){
wp_enqueue_style( 'custom_wp_admin_css', get_template_directory_uri() . '/css/admin.css', false, '1.0.0' );
}
add_action('admin_enqueue_scripts','btb_add_eneque_script',99);
/*Add new and custom Widget ad Dashboard Home ::: WELCOME MESSAGE*/
/*Add new and custom Widget ad Dashboard Home ::: USER INFO OR BIOGRAPHY*/
function btb_add_statistics_widget_for_home(){
$widget_title = "Your Statistics and Posts";
wp_add_dashboard_widget('btb_widget_2', $widget_title, 'btb_statistics_widget');
}
add_action('wp_dashboard_setup','btb_add_statistics_widget_for_home');
function btb_statistics_widget(){
$user_id = get_current_user_id();
$count_query = new WP_Query( array( 'author' => $user_id,'post_type'=>'post','order'=>'DESC' ) ); //For get Post ifo
$post_count = $count_query->post_count;
$comment_count = $count_query->comment_count;
$post_query = new WP_Query( array( 'author' => $user_id,'post_type'=>'post','order'=>'DESC','showposts' => 5 ) );
$latest_posts = $post_query->posts;
?>
Total Post:
Total Comment:
0 && is_array($latest_posts)){
?>
You have no any post yet!';
}
?>