Skip to content

Commit

Permalink
Use dashicon for calendar icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinsays committed Oct 30, 2014
1 parent af318bf commit 86b5a13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
Binary file removed assets/images/calendar.png
Binary file not shown.
34 changes: 10 additions & 24 deletions includes/post-types.php
Expand Up @@ -6,12 +6,12 @@
* Registers the Events CPT.
*
* @access private
* @since 1.0
* @since 1.0
* @return void
*/

function sc_setup_post_types() {

$event_labels = apply_filters('sc_event_labels', array(
'name' => __( 'Events', 'pippin_sc' ),
'singular_name' => __( 'Event', 'pippin_sc' ),
Expand All @@ -23,40 +23,26 @@ function sc_setup_post_types() {
'view_item' => __( 'View Event', 'pippin_sc' ),
'search_items' => __( 'Search Events', 'pippin_sc' ),
'not_found' => __( 'No Events found', 'pippin_sc' ),
'not_found_in_trash'=> __( 'No Events found in Trash', 'pippin_sc') ,
'not_found_in_trash'=> __( 'No Events found in Trash', 'pippin_sc') ,
'parent_item_colon' => '',
'menu_name' => __( 'Events', 'pippin_sc')
) );

$event_args = array(
'labels' => $event_labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => apply_filters( 'sc_event_rewrite', array( 'slug' => 'events', 'with_front' => false ) ),
'capability_type' => apply_filters( 'sc_event_capability_type', 'post' ),
'has_archive' => true,
'has_archive' => true,
'hierarchical' => false,
'menu_icon' => 'dashicons-calendar',
'supports' => apply_filters( 'sc_event_supports', array( 'title', 'editor', 'thumbnail' ) ),
);
);
register_post_type('sc_event', $event_args);

}
add_action('init', 'sc_setup_post_types', 100);


function sc_event_admin_menu_icon() {
?>
<style type="text/css">
#adminmenu #menu-posts-sc_event div.wp-menu-image{
background: transparent url(<?php echo SC_PLUGIN_URL; ?>assets/images/calendar.png) no-repeat 6px -17px;
}
#adminmenu #menu-posts-sc_event:hover div.wp-menu-image,
#adminmenu #menu-posts-sc_event.wp-has-current-submenu div.wp-menu-image {
background-position: 6px 6px;
</style>
<?php
}
add_action( 'admin_head', 'sc_event_admin_menu_icon' );
add_action('init', 'sc_setup_post_types', 100);
4 changes: 4 additions & 0 deletions readme.txt
Expand Up @@ -74,6 +74,10 @@ I have built a [free add-on](http://wordpress.org/extend/plugins/sugar-event-cal

== Changelog ==

= Development =

* Update to use dashicons

= 1.0.3 =

* Fixed a bug with Week Start Day being set to Monday
Expand Down

0 comments on commit 86b5a13

Please sign in to comment.