This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Dashicons SCSS Mixin for Custom Post Type Icons in WordPress 3.8+ | |
* | |
* 1. In your CPT register_post_type function, set " 'menu_icon' => '', " | |
* 2. This will make the class for your admin icon .menu-icon-{slug for Custom Post Type name} | |
* 3. Load a compiled scss stylesheet at wp_head: | |
* | |
* function add_menu_icons_styles(){ | |
* wp_enqueue_style( 'screen', get_template_directory_uri() . '/css/dashicons.css', array(), '0.1.0', 'all' ); | |
* } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dashicons = array( | |
'dashicons-menu', | |
'dashicons-dashboard', | |
'dashicons-admin-site', | |
'dashicons-admin-media', | |
'dashicons-admin-page', | |
'dashicons-admin-comments', | |
'dashicons-admin-appearance', | |
'dashicons-admin-plugins', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { __ } = wp.i18n; | |
const { registerBlockType } = wp.blocks; | |
const el = wp.element.createElement; | |
registerBlockType( 'hiRoy/serverSide', { | |
title: __( 'Server Side Block', 'text-domain' ), | |
icon: 'networking', | |
category: 'common', | |
attributes: { |