Making WordPress.org

Ticket #594: wc-dashicons.diff

File wc-dashicons.diff, 11.5 KB (added by ryelle, 10 years ago)
  • plugins/wc-post-types/wc-post-types.php

     
    191191        function admin_enqueue_scripts() {
    192192                wp_enqueue_style( 'campicons', plugins_url( 'fonts/campicons.css', __FILE__ ), array(), 1 );
    193193        }
    194        
     194
    195195        function wp_enqueue_scripts() {
    196196                wp_enqueue_style( 'wcb_shortcodes', plugins_url( 'css/shortcodes.css', __FILE__ ), array(), 1 );
    197197        }
     
    215215                                break;
    216216                        default:
    217217                }
    218 
    219                 // Post types menu icons
    220                 $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                         <?php
    230                                 $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                 <?php
    244218        }
    245219
    246220        /**
     
    997971
    998972                                <?php while ( $sponsors->have_posts() ) : $sponsors->the_post(); ?>
    999973                                <?php $website = get_post_meta( get_the_ID(), '_wcpt_sponsor_website', true ); ?>
    1000                                        
     974
    1001975                                <div id="wcorg-sponsor-<?php the_ID(); ?>" class="wcorg-sponsor">
    1002976                                        <?php if ( 'website' == $attr['link'] && $website ) : ?>
    1003977                                                <h3><a href="<?php echo esc_attr( esc_url( $website ) ); ?>"><?php the_title(); ?></a></h3>
     
    1004978                                        <?php else : ?>
    1005979                                                <h3><?php the_title(); ?></h3>
    1006980                                        <?php endif; ?>
    1007                                        
     981
    1008982                                        <div class="wcorg-sponsor-description">
    1009983                                                <?php if ( 'website' == $attr['link'] && $website ) : ?>
    1010984                                                        <a href="<?php echo esc_attr( esc_url( $website ) ); ?>"><?php the_post_thumbnail(); ?></a>
     
    1011985                                                <?php else : ?>
    1012986                                                        <?php the_post_thumbnail(); ?>
    1013987                                                <?php endif; ?>
    1014                                                
     988
    1015989                                                <?php the_content(); ?>
    1016990                                        </div>
    1017991                                </div><!-- #sponsor -->
     
    11831157        function metabox_sponsor_info( $sponsor ) {
    11841158                $website = get_post_meta( $sponsor->ID, '_wcpt_sponsor_website', true );
    11851159                wp_nonce_field( 'edit-sponsor-info', 'wcpt-meta-sponsor-info' );
    1186                
     1160
    11871161                ?>
    1188                
     1162
    11891163                <p>
    11901164                        <label for="_wcpt_sponsor_website"><?php _e( 'Website:', 'wordcampbase' ); ?></label>
    11911165                        <input type="text" class="widefat" id="_wcpt_sponsor_website" name="_wcpt_sponsor_website" value="<?php echo esc_attr( esc_url( $website ) ); ?>" />
    11921166                </p>
    1193                
     1167
    11941168                <?php
    11951169        }
    11961170
     
    13111285                delete_post_meta( $post_id, '_wcpt_speaker_id' );
    13121286                foreach ( $speaker_ids as $speaker_id )
    13131287                        add_post_meta( $post_id, '_wcpt_speaker_id', $speaker_id );
    1314                
     1288
    13151289                // Set the speaker as the author of the session post, so the single
    13161290                // view doesn't confuse users who see "posted by [organizer name]"
    13171291                foreach ( $speaker_ids as $speaker_post ) {
    13181292                        $wporg_user_id = get_post_meta( $speaker_post, '_wcpt_user_id', true );
    13191293                        $user = get_user_by( 'id', $wporg_user_id );
    1320                        
     1294
    13211295                        if ( $user ) {
    13221296                                remove_action( 'save_post', array( $this, 'save_post_session' ), 10, 2 );       // avoid infinite recursion
    13231297                                wp_update_post( array(
     
    13251299                                        'post_author' => $user->ID
    13261300                                ) );
    13271301                                add_action( 'save_post', array( $this, 'save_post_session' ), 10, 2 );
    1328                                
     1302
    13291303                                break;
    13301304                        }
    13311305                }
     
    13411315
    13421316                if ( isset( $_POST['wcpt-meta-sponsor-info'] ) && wp_verify_nonce( $_POST['wcpt-meta-sponsor-info'], 'edit-sponsor-info' ) ) {
    13431317                        $website = esc_url_raw( $_POST['_wcpt_sponsor_website'] );
    1344                        
     1318
    13451319                        // 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/
    13461320
    13471321                        if ( $website ) {
     
    13851359                        'capability_type'   => 'post',
    13861360                        'hierarchical'      => false,
    13871361                        'query_var'         => true,
    1388                         'menu_icon'         => '', // see $this->menu_icons_css()
     1362                        'menu_icon'         => 'dashicons-megaphone',
    13891363                ) );
    13901364
    13911365                // Session post type labels.
     
    14171391                        'capability_type'   => 'post',
    14181392                        'hierarchical'      => false,
    14191393                        'query_var'         => true,
    1420                         'menu_icon'         => '', // see $this->menu_icons_css()
     1394                        'menu_icon'         => 'dashicons-schedule',
    14211395                ) );
    14221396
    14231397                // Sponsor post type labels.
     
    14491423                        'capability_type'   => 'post',
    14501424                        'hierarchical'      => false,
    14511425                        'query_var'         => true,
    1452                         'menu_icon'         => '', // see $this->menu_icon_css()
     1426                        'menu_icon'         => 'dashicons-heart',
    14531427                ) );
    14541428
    14551429                // Organizer post type labels.
     
    14811455                        'capability_type'   => 'post',
    14821456                        'hierarchical'      => false,
    14831457                        'query_var'         => true,
    1484                         'menu_icon'         => '', // see $this->menu_icon_css()
     1458                        'menu_icon'         => 'dashicons-groups',
    14851459                ) );
    14861460        }
    14871461
  • plugins/wcpt/wcpt-organizer/organizer-admin.php

     
    9292         * Add some general styling to the admin area
    9393         */
    9494        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 ) : ?>
    9796
    98                 // Top level menu classes
    99                 $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 
    11597                        .column-title { width: 40%; }
    11698                        .column-wcpt_location, .column-wcpt_date, column-wcpt_organizer { white-space: nowrap; }
    11799
  • plugins/wcpt/wcpt-organizer/organizer-loader.php

     
    114114                                        'capability_type'   => 'post',
    115115                                        'hierarchical'      => false,
    116116                                        'query_var'         => true,
    117                                         'menu_icon'         => ''
     117                                        'menu_icon'         => 'dashicons-wordpress',
    118118                                )
    119119                        )
    120120                );
  • plugins/wcpt/wcpt-venue/venue-admin.php

     
    9393         * Add some general styling to the admin area
    9494         */
    9595        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 ) : ?>
    9897
    99                 // Top level menu classes
    100                 $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 
    11698                        .column-title { width: 40%; }
    11799                        .column-wcpt_location, .column-wcpt_date, column-wcpt_organizer { white-space: nowrap; }
    118100
  • plugins/wcpt/wcpt-venue/venue-loader.php

     
    102102                // Register Venue post type
    103103                register_post_type (
    104104                        WCV_POST_TYPE_ID,
    105                         apply_filters( 'wco_register_post_type',
     105                        apply_filters( 'wcv_register_post_type',
    106106                                array (
    107107                                        'labels'            => $labels,
    108108                                        'rewrite'           => $rewrite,
     
    114114                                        'capability_type'   => 'post',
    115115                                        'hierarchical'      => false,
    116116                                        'query_var'         => true,
    117                                         'menu_icon'         => ''
     117                                        'menu_icon'         => 'dashicons-'
    118118                                )
    119119                        )
    120120                );
  • plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

     
    9797         * @return int
    9898         */
    9999        function metabox_save ( $post_id ) {
    100                
     100
    101101                // Don't add/remove meta on revisions and auto-saves
    102102                if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) )
    103103                        return;
    104                
     104
    105105                // WordCamp post type only
    106106                if ( WCPT_POST_TYPE_ID == get_post_type() ) {
    107107                        // Post meta keys
     
    126126
    127127                                                update_post_meta( $post_id, $key, $values[$key] );
    128128                                                break;
    129                                        
     129
    130130                                        default:
    131131                                                do_action( 'wcpt_metabox_save', $key, $value, $post_id );
    132132                                                break;
     
    221221
    222222                return apply_filters( 'wcpt_admin_meta_keys', $retval, $meta_group );
    223223        }
    224        
     224
    225225        /**
    226226         * Fired during admin_print_styles
    227227         * Adds jQuery UI
     
    230230                if ( get_post_type() == WCPT_POST_TYPE_ID )
    231231                        wp_enqueue_script( 'jquery-ui-custom', WCPT_URL . '/assets/js/jquery-ui-1.8.18.custom.min.js', array( 'jquery' ) );
    232232        }
    233        
     233
    234234        function admin_print_scripts() {
    235235                if ( get_post_type() == WCPT_POST_TYPE_ID ) :
    236236                ?>
     
    244244                <?php
    245245                endif;
    246246        }
    247        
     247
    248248        function admin_styles() {
    249249                if ( get_post_type() == WCPT_POST_TYPE_ID )
    250250                        wp_enqueue_style( 'jquery-ui-redmond', WCPT_URL . '/assets/css/redmond/jquery-ui-1.8.18.custom.css' );
     
    256256         * Add some general styling to the admin area
    257257         */
    258258        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 ) : ?>
    261260
    262                 // Top level menu classes
    263                 $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 
    279261                        .column-title { width: 40%; }
    280262                        .column-wcpt_location, .column-wcpt_date, column-wcpt_organizer { white-space: nowrap; }
    281263
  • plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php

     
    126126                                        'hierarchical'      => false,
    127127                                        'has_archive'       => true,
    128128                                        'query_var'         => true,
    129                                         'menu_icon'         => ''
     129                                        'menu_icon'         => 'dashicons-wordpress',
    130130                                )
    131131                        )
    132132                );