Ticket #610: 610.diff
File 610.diff, 3.3 KB (added by , 10 years ago) |
---|
-
.
-
plugins/wc-post-types/css/admin.css
Property changes on: . ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +upgrade
4 4 } 5 5 #wcb_session_time { 6 6 width: 80px; 7 } 8 #dashboard_right_now a.tix_attendee-count:before, 9 #dashboard_right_now span.tix_attendee-count:before { 10 content: "\f307"; 11 } 12 #dashboard_right_now a.wcb_speaker-count:before, 13 #dashboard_right_now span.wcb_speaker-count:before { 14 content: "\f488"; 15 } 16 #dashboard_right_now a.wcb_session-count:before, 17 #dashboard_right_now span.wcb_session-count:before { 18 content: "\f489"; 19 } 20 #dashboard_right_now a.wcb_sponsor-count:before, 21 #dashboard_right_now span.wcb_sponsor-count:before { 22 content: "\f487"; 7 23 } 24 No newline at end of file -
plugins/wc-post-types/wc-post-types.php
44 44 add_shortcode( 'sponsors', array( $this, 'shortcode_sponsors' ) ); 45 45 add_shortcode( 'organizers', array( $this, 'shortcode_organizers' ) ); 46 46 add_shortcode( 'schedule', array( $this, 'shortcode_schedule' ) ); 47 48 add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 ); 47 49 } 48 50 49 51 function init() { … … 211 213 case 'edit-wcb_speaker': 212 214 case 'edit-wcb_sponsor': 213 215 case 'edit-wcb_session': 216 case 'dashboard': 214 217 wp_enqueue_style( 'wcpt-admin', plugins_url( '/css/admin.css', __FILE__ ), array(), 1 ); 215 218 break; 216 219 default: … … 1650 1653 register_widget( 'WCPT_Widget_Sessions' ); 1651 1654 register_widget( 'WCPT_Widget_Organizers' ); 1652 1655 } 1656 1657 /** 1658 * Add post types to 'At a Glance' dashboard widget 1659 */ 1660 function glance_items( $items = array() ) { 1661 $post_types = array( 'tix_attendee', 'wcb_speaker', 'wcb_session', 'wcb_sponsor' ); 1662 1663 foreach( $post_types as $type ) { 1664 1665 if( ! post_type_exists( $type ) ) continue; 1666 1667 $num_posts = wp_count_posts( $type ); 1668 1669 if( $num_posts ) { 1670 1671 $published = intval( $num_posts->publish ); 1672 $post_type = get_post_type_object( $type ); 1673 1674 $text = _n( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $published, 'your_textdomain' ); 1675 $text = sprintf( $text, number_format_i18n( $published ) ); 1676 1677 if ( current_user_can( $post_type->cap->edit_posts ) ) { 1678 $items[] = sprintf( '<a class="%1$s-count" href="edit.php?post_type=%1$s">%2$s</a>', $type, $text ) . "\n"; 1679 } else { 1680 $items[] = sprintf( '<span class="%1$s-count">%2$s</span>', $type, $text ) . "\n"; 1681 } 1682 } 1683 } 1684 1685 return $items; 1686 } 1653 1687 } 1654 1688 1655 1689 // Load the plugin class. -
themes