CPT_Core icon indicating copy to clipboard operation
CPT_Core copied to clipboard

Support for Dashboard At Glance Widget

Open Mte90 opened this issue 11 years ago • 2 comments

i've seen this snippet and i think that will be useful if integrated in this library.

http://wpsnipp.com/index.php/functions-php/wordpress-post-types-dashboard-at-glance-widget/

Mte90 avatar Jun 28 '14 10:06 Mte90

any news for that?

Mte90 avatar Mar 03 '16 11:03 Mte90

image

register_via_cpt_core( array(
 	__( 'Q & A item', 'your-text-domain' ), // Singular
 	__( 'Q & A items', 'your-text-domain' ), // Plural
 	'q-and-a-items' // Registered name/slug
 ) );
 
 register_via_cpt_core( array(
	 __( 'Test CPT', 'your-text-domain' ), // Singular
	 __( 'Test CPTs', 'your-text-domain' ), // Plural
	 'tests' // Registered name/slug
 ) );
 
register_via_cpt_core( array(
	__( 'ABC item', 'your-text-domain' ), // Singular
	__( 'ABC items', 'your-text-domain' ), // Plural
	'abcs' // Registered name/slug
 ) );

I didn't add css for that, so it uses default WordPress icons for "At a glance" items. I don't think we need a custom icon here, because it always will be the same for each CPT registered via CPT Core. Regarding the code itself, I had to use static variable to count number of CPT's registration calls, to limit "At a glance" widget modifications. Also, I'm not sure if we should keep this code in library or we need to move it into code snippets as an example. @JayWood what are your thoughts on this?

PavelK27 avatar Jun 20 '17 21:06 PavelK27