Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Dashboard At Glance Widget #2

Open
Mte90 opened this issue Jun 28, 2014 · 2 comments
Open

Support for Dashboard At Glance Widget #2

Mte90 opened this issue Jun 28, 2014 · 2 comments

Comments

@Mte90
Copy link
Contributor

Mte90 commented Jun 28, 2014

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
Copy link
Contributor Author

Mte90 commented Mar 3, 2016

any news for that?

@PavelK27
Copy link

PavelK27 commented Jun 20, 2017

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 PavelK27 removed their assignment Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants