Changeset 1298
- Timestamp:
- 02/24/2015 07:31:13 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/page-dashicons.php
r1272 r1298 336 336 337 337 <pre><?php 338 add_action( 'init', 'create_post_type' ); 339 //Registers the Product's post type 340 function create_post_type() { 338 /** 339 * Register the Product post type with a Dashicon. 340 * 341 * @see register_post_type() 342 */ 343 function wpdocs_create_post_type() { 341 344 register_post_type( 'acme_product', 342 345 array( 343 346 'labels' => array( 344 'name' => __( 'Products' ),345 'singular_name' => __( 'Product' )347 'name' => __( 'Products', 'textdomain' ), 348 'singular_name' => __( 'Product', 'textdomain' ) 346 349 ), 347 'public' => true,350 'public' => true, 348 351 'has_archive' => true, 349 'menu_icon' => 'dashicons-products',352 'menu_icon' => 'dashicons-products', 350 353 ) 351 354 ); 352 355 } 356 add_action( 'init', 'wpdocs_create_post_type', 0 ); 353 357 </pre> 354 358 … … 359 363 360 364 <pre><?php 361 function add_my_custom_menu() { 362 //add an item to the menu 365 /** 366 * Register a menu page with a Dashicon. 367 * 368 * @see add_menu_page() 369 */ 370 function wpdocs_add_my_custom_menu() { 371 // Add an item to the menu. 363 372 add_menu_page ( 364 'My Page',365 'My Title',373 __( 'My Page', 'textdomain' ), 374 __( 'My Title', 'textdomain' ), 366 375 'manage_options', 367 376 'my-page',
Note: See TracChangeset
for help on using the changeset viewer.