【插件注釋】:
~~~
<?php
/**
*Plugin Name: Basic Plugin
*Plugin URI:
*Author: Neo
*Author URI:
*Version: 1.1
*License: GPLv2
*/
~~~
如圖所示:

【當前窗口彈出的鏈接】:
~~~
<?php
/**
*Plugin Name: Basic Plugin
*Plugin URI:
*Author: Neo
*Author URI:
*Version: 1.1
*License: GPLv2
*/
function dwwp_add_google_link() {
global $wp_admin_bar;
$wp_admin_bar->add_menu(array(
'id'=> 'google_analytics',
'title' => 'Google Analytics',
'href' => 'http://google.com/analytics',
'target' => ''
));
}
add_action('wp_before_admin_bar_render', 'dwwp_add_google_link');
~~~
如圖所示:

【Book Post Type】
~~~
<?php
/**
*Plugin Name: Book Post Type
*Plugin URI:
*Author: Neo
*Author URI:
*Version: 1.1
*License: GPLv2
*/
//book post type
function cptui_register_my_cpts_book() {
/**
* Post Type: book.
*/
$labels = array(
"name" => __( "book", "twentyseventeen" ),
"singular_name" => __( "book", "twentyseventeen" ),
"menu_name" => __( "book", "twentyseventeen" ),
);
$args = array(
"label" => __( "book", "twentyseventeen" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"has_archive" => false,
"show_in_menu" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => array( "slug" => "book", "with_front" => true ),
"menu_icon" =>"dashicons-welcome-write-blog",
"query_var" => true,
"supports" => array( "title", "editor", "thumbnail", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "author", "page-attributes", "post-formats" ),
"taxonomies" => array( "category", "post_tag" ),
);
register_post_type( "book", $args );
}
add_action( 'init', 'cptui_register_my_cpts_book' );
~~~
如圖所示:

【參考】:
wordpress menu_icon:
<a href="https://developer.wordpress.org/resource/dashicons/#welcome-write-blog" target="_blank">https://developer.wordpress.org/resource/dashicons/#welcome-write-blog</a>
- WordPress平臺的網站開發
- 電商主題開發
- WooCommerce主題開發優化部分
- 首頁開發
- WooCommerce
- 判斷用戶是否登錄
- WordPress Menu
- WooCommerce PayPal Checkout Gateway
- 頁面和文章
- 調用產品和文章
- 判斷屬于哪個頁面
- 相關文章
- 消除文章分享按鈕集底部的文字
- wordpress主題模板和主題開發
- wordpress主題準備
- wordpress主題文件結構
- 豪源主題
- WooCommerce SEO
- 插件開發
- wordpress二次開發
- theme基本顯示
- menu調用
- 分拆為header.php和footer.php
- 頁面、文章樣式選擇顯示
- 面包屑導航 Breadcrumb
- 特色圖
- 閱讀次數統計
- 分頁功能
- Advanced Custom Fields
- Custom Post Type UI
- post type
- 小工具
- 小工具調用
- shortcode
- 文章循環輸出
- 標題和文章限制字數輸出顯示
- WordPress主題theme1開發
- wordpress搭建多站點
- wordpress常用函數
- wordpress循環代碼
- Woocommerce
- Woocommerce支持
- WordPress插件開發
- wordpress會員插件
- WordPress插件使用
- WordPress插件集
- WordPress的核心
- Wordpress原理
- Wordpress要點
- WordPress網站搬家
- WPML
- 服務器
- Cloud 9
- test
- 網站