Ticket #610: 610-meta.diff
File 610-meta.diff, 3.0 KB (added by , 10 years ago) |
---|
-
wp-content/plugins/wc-post-types/css/admin.css
4 4 } 5 5 #wcb_session_time { 6 6 width: 80px; 7 } 8 #dashboard_right_now a.wcb_speaker-count:before, 9 #dashboard_right_now span.wcb_speaker-count:before { 10 content: "\f488"; 11 } 12 #dashboard_right_now a.wcb_session-count:before, 13 #dashboard_right_now span.wcb_session-count:before { 14 content: "\f489"; 15 } 16 #dashboard_right_now a.wcb_sponsor-count:before, 17 #dashboard_right_now span.wcb_sponsor-count:before { 18 content: "\f487"; 7 19 } 20 No newline at end of file -
wp-content/plugins/wc-post-types/wc-post-types.php
49 49 add_filter( 'the_content', array( $this, 'add_avatar_to_speaker_posts' ) ); 50 50 add_filter( 'the_content', array( $this, 'add_speaker_info_to_session_posts' ) ); 51 51 add_filter( 'the_content', array( $this, 'add_session_info_to_speaker_posts' ) ); 52 53 add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ) ); 52 54 } 53 55 54 56 function init() { … … 248 250 case 'edit-wcb_speaker': 249 251 case 'edit-wcb_sponsor': 250 252 case 'edit-wcb_session': 253 case 'dashboard': 251 254 wp_enqueue_style( 'wcpt-admin', plugins_url( '/css/admin.css', __FILE__ ), array(), 1 ); 252 255 break; 253 256 default: … … 1884 1887 register_widget( 'WCPT_Widget_Sessions' ); 1885 1888 register_widget( 'WCPT_Widget_Organizers' ); 1886 1889 } 1890 1891 /** 1892 * Add post types to 'At a Glance' dashboard widget 1893 */ 1894 function glance_items( $items = array() ) { 1895 $post_types = array( 'wcb_speaker', 'wcb_session', 'wcb_sponsor' ); 1896 1897 foreach ( $post_types as $post_type ) { 1898 1899 if ( ! post_type_exists( $post_type ) ) { 1900 continue; 1901 } 1902 1903 $num_posts = wp_count_posts( $post_type ); 1904 $post_type_object = get_post_type_object( $post_type ); 1905 1906 if ( $num_posts && $num_posts->publish ) { 1907 1908 switch ( $post_type ) { 1909 case 'wcb_speaker': 1910 $text = $text = _n( '%s Speaker', '%s Speakers', $num_posts->publish ); 1911 break; 1912 case 'wcb_session': 1913 $text = $text = _n( '%s Session', '%s Sessions', $num_posts->publish ); 1914 break; 1915 case 'wcb_sponsor': 1916 $text = $text = _n( '%s Sponsor', '%s Sponsors', $num_posts->publish ); 1917 break; 1918 default: 1919 } 1920 1921 $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); 1922 1923 if ( current_user_can( $post_type_object->cap->edit_posts ) ) { 1924 $items[] = sprintf( '<a class="%1$s-count" href="edit.php?post_type=%1$s">%2$s</a>', $post_type, $text ) . "\n"; 1925 } else { 1926 $items[] = sprintf( '<span class="%1$s-count">%2$s</span>', $post_type, $text ) . "\n"; 1927 } 1928 } 1929 } 1930 1931 return $items; 1932 } 1887 1933 } 1888 1934 1889 1935 // Load the plugin class.