AI Verified
Add custom post types to the At a Glance Dashboard widget
This snippet adds your custom post types to the "At a Glance" widget on your WordPress Dashboard. By default, only Posts and Pages display, but this snippet will allow you to pull in counters for all of your CPTs.
PHP
Voted: 1 by 1 user(s)
• "Only run in administration area" in the snippet settings. • You will need to replace "custom-post-type-x" with the slug of your custom post type.
Scroll down to see more snippets from this codevault.
The author has indicated that this snippet is compatable up to wordpress version: 6.1
Our AI bot has checked this snippet is compatable up to wordpress version: 6.1
Free & Pro
Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.
Pro Only (Coming Soon)
You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.
Last modified:
30/11/2023
This snippet has the following status:
AI Verified
This snippet has been tested by our AI bot, see any comments below.
AI Bot Comments:
Potential vulnerability found : Cross Site Scripting
Found on line : 18
Code : printf( '<span class="page-count">%1$s</span>', esc_html( $text )
Vulnerable line : 13
Code : $text = _n( $cpt_info->labels->singular_name, $cpt_info->labels->name, $num )); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle,WordPress.WP.I18n.NonSingularStringLiteralPlural
Found 1 vulnerabilities
1
9 months ago
Updated today to remove xss vulnerability.
Please see some snippets below related to this snippet..
WordPress Admin
AI Verified
Added: 1 year ago
Last Updated: 1 year ago
Have a user role that you want to hide "Show Toolbar when viewing site" checkbox on the profile page? This will remove the checkbox on specific user roles so Admins can control who has the admin toolb...
WordPress Admin
AI Verified
Added: 1 year ago
Last Updated: 1 year ago
Hide admin notices for all users except 1, defined by user ID
WordPress Admin
AI Verified
Added: 1 month ago
Last Updated: 1 month ago
Changes the position of the 'ID' column in the Snippets table.
These are some popular snippets from this users codevault..
WordPress Admin
AI Verified
Added: 10 months ago
Last Updated: 9 months ago
This snippet adds your custom post types to the "At a Glance" widget on your WordPress Dashboard. By default, only Posts and Pages display, but this snippet will allow you to pull in counters for all...
WordPress Admin
AI Verified
Added: 10 months ago
Last Updated: 9 months ago
This snippet adds custom icons to your custom post type counters in the At a Glance widgets on your WordPress Dashboard. I have a snippet in my Codevault on how to add CPTs to this widget too.
Divi Builder
AI Verified
Added: 10 months ago
Last Updated: 9 months ago
This snippet enables Dynamic Content in the number field of Divi's Number Counter module. This would then allow you to control the content through a plugin such as ACF rather than the Divi Builder.
Category
Snippet Status