Use the second parameter $post_type
:
count_user_posts( $current_user->ID, 'my_post_type' );
More information on count_user_posts()
Related Posts:
- Fatal error: Call to undefined function mysql_connect()
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- Childs PHP files not overwriting Parent’s PHP files
- How will php 7 affect WordPress?
- How to add active class to custom menu using while loop and wp_list_pages
- How can I run a .php file located in my site’s root folder?
- How to return a string that has a variable inside in a shortcode?
- Saving metabox repeatable fields
- Get list of WP Updates Across Sites
- Switching between custom templates in a post type of the admin menu
- Woocommerce HTML email option unavailable
- Use template for posts with a particular category grandparent
- How to add a custom id to each post URL in wordpress
- How to start a script from cli within wordpress
- How to group 2 radio buttons in a widget?
- Custom Plugin For Converting CSV To MySQL
- What’s the best user registration library to integrate WordPress?
- Missing sidebar parameter “fix” – before_content
- WordPress add post format support not working
- Page Automatically Generated from Theme?
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- How do I exclude recent post from recent post php widget
- Move category description below post list in blog
- WordPress Script stops suddenly
- Woocommerce api: create product with images – bad request
- WordPress admin pointers tour bug?
- Get term siblings of current child taxonomy
- Upload file could not be moved to wp-content/uploads
- HTML tags not showing in excerpt
- wp_mail file attachment not being placed in upload folder?
- Add .htm extention to a custom taxonomy
- Pagination for custom shop loop woocommerce
- WordPress from url get external source title
- Automatically set all tags to have a height of 0 if there is no content inside the tag [closed]
- if statement with is_active_sidebar()
- wp ajax return 0
- How to add API security keys into JS of wordpress securely
- How to use theme function in post/page?
- Logic on a Gravity Forms redirect [closed]
- Warning: in_array() null given in PHP function
- Convert code – not work
- Environment to do updates to legacy (4.7) version of WP while staying on php 5.6?
- How can I count ACF sub_field with a certain value
- wpdb Cannot Update column in Database
- Custom Registration username_exists / email_exists
- WordPress language switcher doesn’t work
- Custom posts password protect
- Search.php gets metadata from first post
- Contact Form 7 WordPress, checking a few fields, if empty then invalid
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- WordPress Multisite login_redirect to primary blog and specific page based on role
- Pagination at category doesnt work with same name of page
- How to remove the two duplicate values
- Date translation doesn’t work
- Is it secure to use SMTP password in .php file in WordPress website?
- Woocommerce – Exclude variation attribute on specific variation
- call to undefined function mysql_connect
- Can’t pass var from php wp_ajax into ajax script : result undefined or null
- Custom PHP form needs refresh to load page correctly
- WordPress add custom search
- How to override theme’s public static function inside of a trait?
- pass datetime using wp_localize_script to frontend from settings page
- Advanced Custom Forms PHP formatting for do_shortcode
- Infinite loop when logging out using custom login form
- add custom metabox to media library custom widget
- wp_signon works local, not on https
- Get WordPress username to customize url
- Delete empty title_tags, find a h1 heading and echo it
- add_action in wp_head accessible from class
- WP_Query To Display Product Of Brand On Taxonomy Page
- Let user select the number of posts shown per page jquery error
- How to have more than one ID included in the exclude command?
- Search for images that width and height is more than 500
- How do I get object if class is instantiated only like this new classname()
- How to create a php page to collect information from a html page
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- Can’t make product images clickable
- wordpress ajax return 0
- I need help implement a Javascript code into the PHP file
- Passing different content to template parts
- divide custom field values in div every two values
- Weird slug in archives permalink
- Admin bar nodes
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Run insert if no entry otherwise run update with ajax
- Hide cart when empty [closed]
- WP Ecommerce: Display the “Order Notes” as column in the Sales Log [closed]
- Post Title Not showing up
- if is_home(), change class of menu-item-225 of wp_nav_menu
- WordPress most commented posts of last X days
- How to check if a value exists in one of two database tables
- How to dynamically change webcam photo timestamps
- What is the wrong with this function to enqueue the scripts and styles to the theme? [closed]
- How to use multiple 404 Error Pages in WordPress
- Parse error: syntax error, unexpected ‘}’ in
- How can I get values from a custom post type depending on where I click on my SVG map?
- a problem in class in class-wp-hook.php
- How do I a custom search form by taxonomies?
- WordPress REST API – Custom field not added to pages
- Woocommerce – add tracking code to another email template