Ticket #594: wc-dashicons.diff
File wc-dashicons.diff, 11.5 KB (added by , 10 years ago) |
---|
-
plugins/wc-post-types/wc-post-types.php
191 191 function admin_enqueue_scripts() { 192 192 wp_enqueue_style( 'campicons', plugins_url( 'fonts/campicons.css', __FILE__ ), array(), 1 ); 193 193 } 194 194 195 195 function wp_enqueue_scripts() { 196 196 wp_enqueue_style( 'wcb_shortcodes', plugins_url( 'css/shortcodes.css', __FILE__ ), array(), 1 ); 197 197 } … … 215 215 break; 216 216 default: 217 217 } 218 219 // Post types menu icons220 $menu_icons = array(221 'wcb_speaker' => '\e602',222 'wcb_session' => '\e603',223 'wcb_sponsor' => '\e601',224 );225 226 ?>227 <style type="text/css">228 <?php foreach ( $menu_icons as $post_type => $icon_content ): ?>229 <?php230 $class = sanitize_html_class( $post_type );231 ?>232 #menu-posts-<?php echo $class; ?> .wp-menu-image:before {233 font-family: 'Campicons' !important;234 content: '<?php echo $icon_content; ?>' !important;235 }236 <?php endforeach; ?>237 238 #menu-posts-wcb_organizer .wp-menu-image:before {239 font-family: 'Dashicons';240 content: "\f338";241 }242 </style>243 <?php244 218 } 245 219 246 220 /** … … 997 971 998 972 <?php while ( $sponsors->have_posts() ) : $sponsors->the_post(); ?> 999 973 <?php $website = get_post_meta( get_the_ID(), '_wcpt_sponsor_website', true ); ?> 1000 974 1001 975 <div id="wcorg-sponsor-<?php the_ID(); ?>" class="wcorg-sponsor"> 1002 976 <?php if ( 'website' == $attr['link'] && $website ) : ?> 1003 977 <h3><a href="<?php echo esc_attr( esc_url( $website ) ); ?>"><?php the_title(); ?></a></h3> … … 1004 978 <?php else : ?> 1005 979 <h3><?php the_title(); ?></h3> 1006 980 <?php endif; ?> 1007 981 1008 982 <div class="wcorg-sponsor-description"> 1009 983 <?php if ( 'website' == $attr['link'] && $website ) : ?> 1010 984 <a href="<?php echo esc_attr( esc_url( $website ) ); ?>"><?php the_post_thumbnail(); ?></a> … … 1011 985 <?php else : ?> 1012 986 <?php the_post_thumbnail(); ?> 1013 987 <?php endif; ?> 1014 988 1015 989 <?php the_content(); ?> 1016 990 </div> 1017 991 </div><!-- #sponsor --> … … 1183 1157 function metabox_sponsor_info( $sponsor ) { 1184 1158 $website = get_post_meta( $sponsor->ID, '_wcpt_sponsor_website', true ); 1185 1159 wp_nonce_field( 'edit-sponsor-info', 'wcpt-meta-sponsor-info' ); 1186 1160 1187 1161 ?> 1188 1162 1189 1163 <p> 1190 1164 <label for="_wcpt_sponsor_website"><?php _e( 'Website:', 'wordcampbase' ); ?></label> 1191 1165 <input type="text" class="widefat" id="_wcpt_sponsor_website" name="_wcpt_sponsor_website" value="<?php echo esc_attr( esc_url( $website ) ); ?>" /> 1192 1166 </p> 1193 1167 1194 1168 <?php 1195 1169 } 1196 1170 … … 1311 1285 delete_post_meta( $post_id, '_wcpt_speaker_id' ); 1312 1286 foreach ( $speaker_ids as $speaker_id ) 1313 1287 add_post_meta( $post_id, '_wcpt_speaker_id', $speaker_id ); 1314 1288 1315 1289 // Set the speaker as the author of the session post, so the single 1316 1290 // view doesn't confuse users who see "posted by [organizer name]" 1317 1291 foreach ( $speaker_ids as $speaker_post ) { 1318 1292 $wporg_user_id = get_post_meta( $speaker_post, '_wcpt_user_id', true ); 1319 1293 $user = get_user_by( 'id', $wporg_user_id ); 1320 1294 1321 1295 if ( $user ) { 1322 1296 remove_action( 'save_post', array( $this, 'save_post_session' ), 10, 2 ); // avoid infinite recursion 1323 1297 wp_update_post( array( … … 1325 1299 'post_author' => $user->ID 1326 1300 ) ); 1327 1301 add_action( 'save_post', array( $this, 'save_post_session' ), 10, 2 ); 1328 1302 1329 1303 break; 1330 1304 } 1331 1305 } … … 1341 1315 1342 1316 if ( isset( $_POST['wcpt-meta-sponsor-info'] ) && wp_verify_nonce( $_POST['wcpt-meta-sponsor-info'], 'edit-sponsor-info' ) ) { 1343 1317 $website = esc_url_raw( $_POST['_wcpt_sponsor_website'] ); 1344 1318 1345 1319 // TODO: maybe only allows links to home page, depending on outcome of http://make.wordpress.org/community/2013/12/31/irs-rules-for-corporate-sponsorship-of-wordcamp/ 1346 1320 1347 1321 if ( $website ) { … … 1385 1359 'capability_type' => 'post', 1386 1360 'hierarchical' => false, 1387 1361 'query_var' => true, 1388 'menu_icon' => ' ', // see $this->menu_icons_css()1362 'menu_icon' => 'dashicons-megaphone', 1389 1363 ) ); 1390 1364 1391 1365 // Session post type labels. … … 1417 1391 'capability_type' => 'post', 1418 1392 'hierarchical' => false, 1419 1393 'query_var' => true, 1420 'menu_icon' => ' ', // see $this->menu_icons_css()1394 'menu_icon' => 'dashicons-schedule', 1421 1395 ) ); 1422 1396 1423 1397 // Sponsor post type labels. … … 1449 1423 'capability_type' => 'post', 1450 1424 'hierarchical' => false, 1451 1425 'query_var' => true, 1452 'menu_icon' => ' ', // see $this->menu_icon_css()1426 'menu_icon' => 'dashicons-heart', 1453 1427 ) ); 1454 1428 1455 1429 // Organizer post type labels. … … 1481 1455 'capability_type' => 'post', 1482 1456 'hierarchical' => false, 1483 1457 'query_var' => true, 1484 'menu_icon' => ' ', // see $this->menu_icon_css()1458 'menu_icon' => 'dashicons-groups', 1485 1459 ) ); 1486 1460 } 1487 1461 -
plugins/wcpt/wcpt-organizer/organizer-admin.php
92 92 * Add some general styling to the admin area 93 93 */ 94 94 function admin_head () { 95 // Icons for top level admin menus 96 $menu_icon_url = WCPT_IMAGES_URL . '/icon-organizer.png'; 95 if ( $_GET['post_type'] == WCO_POST_TYPE_ID ) : ?> 97 96 98 // Top level menu classes99 $icon_class = sanitize_html_class( WCO_POST_TYPE_ID ); ?>100 101 #menu-posts-<?php echo $icon_class; ?> .wp-menu-image {102 background: url(<?php echo $menu_icon_url; ?>) no-repeat 0 -32px;103 }104 #menu-posts-<?php echo $icon_class; ?>:hover .wp-menu-image,105 #menu-posts-<?php echo $icon_class; ?>.wp-has-current-submenu .wp-menu-image {106 background: url(<?php echo $menu_icon_url; ?>) no-repeat 0 0;107 }108 109 <?php if ( $_GET['post_type'] == WCO_POST_TYPE_ID ) : ?>110 111 #icon-edit, #icon-post {112 background: url(<?php echo WCPT_IMAGES_URL . '/icon32.png'; ?>) no-repeat 4px 0;113 }114 115 97 .column-title { width: 40%; } 116 98 .column-wcpt_location, .column-wcpt_date, column-wcpt_organizer { white-space: nowrap; } 117 99 -
plugins/wcpt/wcpt-organizer/organizer-loader.php
114 114 'capability_type' => 'post', 115 115 'hierarchical' => false, 116 116 'query_var' => true, 117 'menu_icon' => ' '117 'menu_icon' => 'dashicons-wordpress', 118 118 ) 119 119 ) 120 120 ); -
plugins/wcpt/wcpt-venue/venue-admin.php
93 93 * Add some general styling to the admin area 94 94 */ 95 95 function admin_head () { 96 // Icons for top level admin menus 97 $menu_icon_url = WCPT_IMAGES_URL . '/icon-venue.png'; 96 if ( $_GET['post_type'] == WCV_POST_TYPE_ID ) : ?> 98 97 99 // Top level menu classes100 $class = sanitize_html_class( WCV_POST_TYPE_ID ); ?>101 102 #menu-posts-<?php echo $class; ?> .wp-menu-image {103 background: url(<?php echo $menu_icon_url; ?>) no-repeat 0 -32px;104 }105 #menu-posts-<?php echo $class; ?>:hover .wp-menu-image,106 #menu-posts-<?php echo $class; ?>.wp-has-current-submenu .wp-menu-image {107 background: url(<?php echo $menu_icon_url; ?>) no-repeat 0 0;108 }109 110 <?php if ( $_GET['post_type'] == WCV_POST_TYPE_ID ) : ?>111 112 #icon-edit, #icon-post {113 background: url(<?php echo WCPT_IMAGES_URL . '/icon32.png'; ?>) no-repeat 4px 0;114 }115 116 98 .column-title { width: 40%; } 117 99 .column-wcpt_location, .column-wcpt_date, column-wcpt_organizer { white-space: nowrap; } 118 100 -
plugins/wcpt/wcpt-venue/venue-loader.php
102 102 // Register Venue post type 103 103 register_post_type ( 104 104 WCV_POST_TYPE_ID, 105 apply_filters( 'wc o_register_post_type',105 apply_filters( 'wcv_register_post_type', 106 106 array ( 107 107 'labels' => $labels, 108 108 'rewrite' => $rewrite, … … 114 114 'capability_type' => 'post', 115 115 'hierarchical' => false, 116 116 'query_var' => true, 117 'menu_icon' => ' '117 'menu_icon' => 'dashicons-' 118 118 ) 119 119 ) 120 120 ); -
plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php
97 97 * @return int 98 98 */ 99 99 function metabox_save ( $post_id ) { 100 100 101 101 // Don't add/remove meta on revisions and auto-saves 102 102 if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) ) 103 103 return; 104 104 105 105 // WordCamp post type only 106 106 if ( WCPT_POST_TYPE_ID == get_post_type() ) { 107 107 // Post meta keys … … 126 126 127 127 update_post_meta( $post_id, $key, $values[$key] ); 128 128 break; 129 129 130 130 default: 131 131 do_action( 'wcpt_metabox_save', $key, $value, $post_id ); 132 132 break; … … 221 221 222 222 return apply_filters( 'wcpt_admin_meta_keys', $retval, $meta_group ); 223 223 } 224 224 225 225 /** 226 226 * Fired during admin_print_styles 227 227 * Adds jQuery UI … … 230 230 if ( get_post_type() == WCPT_POST_TYPE_ID ) 231 231 wp_enqueue_script( 'jquery-ui-custom', WCPT_URL . '/assets/js/jquery-ui-1.8.18.custom.min.js', array( 'jquery' ) ); 232 232 } 233 233 234 234 function admin_print_scripts() { 235 235 if ( get_post_type() == WCPT_POST_TYPE_ID ) : 236 236 ?> … … 244 244 <?php 245 245 endif; 246 246 } 247 247 248 248 function admin_styles() { 249 249 if ( get_post_type() == WCPT_POST_TYPE_ID ) 250 250 wp_enqueue_style( 'jquery-ui-redmond', WCPT_URL . '/assets/css/redmond/jquery-ui-1.8.18.custom.css' ); … … 256 256 * Add some general styling to the admin area 257 257 */ 258 258 function admin_head () { 259 // Icons for top level admin menus 260 $menu_icon_url = WCPT_IMAGES_URL . '/icon-wordcamp.png'; 259 if ( !empty( $_GET['post_type'] ) && $_GET['post_type'] == WCPT_POST_TYPE_ID ) : ?> 261 260 262 // Top level menu classes263 $class = sanitize_html_class( WCPT_POST_TYPE_ID ); ?>264 265 #menu-posts-<?php echo $class; ?> .wp-menu-image {266 background: url(<?php echo $menu_icon_url; ?>) no-repeat 0 -32px;267 }268 #menu-posts-<?php echo $class; ?>:hover .wp-menu-image,269 #menu-posts-<?php echo $class; ?>.wp-has-current-submenu .wp-menu-image {270 background: url(<?php echo $menu_icon_url; ?>) no-repeat 0 0;271 }272 273 <?php if ( !empty( $_GET['post_type'] ) && $_GET['post_type'] == WCPT_POST_TYPE_ID ) : ?>274 275 #icon-edit, #icon-post {276 background: url(<?php echo WCPT_IMAGES_URL . '/icon32.png'; ?>) no-repeat 4px 0;277 }278 279 261 .column-title { width: 40%; } 280 262 .column-wcpt_location, .column-wcpt_date, column-wcpt_organizer { white-space: nowrap; } 281 263 -
plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php
126 126 'hierarchical' => false, 127 127 'has_archive' => true, 128 128 'query_var' => true, 129 'menu_icon' => ' '129 'menu_icon' => 'dashicons-wordpress', 130 130 ) 131 131 ) 132 132 );