Index: js/page-dashicons.js =================================================================== --- js/page-dashicons.js (revision 1018) +++ js/page-dashicons.js (working copy) @@ -37,11 +37,13 @@ var tmpl = wp.template( 'glyphs' ); jQuery( '#glyph' ).html( tmpl({ - cssClass: cssClass, + cssClass: 'dashicons-' + permalink, attr: attr, html: htmltext, glyph: glyphtext }) ); + + jQuery( '#wp-class-example' ).text( permalink ); } }; @@ -50,7 +52,7 @@ jQuery(document).ready(function() { // pick random icon if no permalink, otherwise go to permalink - if ( window.location.hash ) { + if ( window.location.hash && '#instructions' !== window.location.hash ) { permalink = "dashicons-" + window.location.hash.split('#')[1]; // sanitize Index: page-dashicons.php =================================================================== --- page-dashicons.php (revision 1018) +++ page-dashicons.php (working copy) @@ -302,27 +302,69 @@
register_post_type and add_menu_page
, which both have an option to set an icon. To show the current icon, you should pass in %s.', 'wporg' ), '\'dashicons-{icon}\'
' ); ?>
register_post_type, set menu_icon
in the arguments array.', 'wporg' ); ?>
<link rel="stylesheet" href="css/dashicons.css">+
<?php +add_action( 'init', 'create_post_type' ); +//Registers the Product's post type +function create_post_type() { + register_post_type( 'acme_product', + array( + 'labels' => array( + 'name' => __( 'Products' ), + 'singular_name' => __( 'Product' ) + ), + 'public' => true, + 'has_archive' => true, + 'menu_icon' => 'dashicons-products', + ) + ); +} +-
:before' ); ?>
+add_menu_page accepts a parameter after the callback function for an icon URL, which can also accept a dashicons class.', 'wporg' ); ?>
- +<?php +function add_my_custom_menu() { + //add an item to the menu + add_menu_page ( + 'My Page', + 'My Title', + 'manage_options', + 'my-page', + 'my_admin_page_function', + 'dashicons-admin-media', + ); +}+ + +
dashicons-before and dashicons
, and they can be thought of as setting up dashicons (since you still need your icon's class, too).", 'wporg' ); ?>
+<h2 class="dashicons-before dashicons-smiley"></h2> ++ + + +
+<h2><span class="dashicons dashicons-smiley"></span> </h2> ++ + + + +