Skip to content

Instantly share code, notes, and snippets.

@twlca twlca/lca_docs.php
Created Apr 24, 2016

Embed
What would you like to do?
<?php
/**
* Plugin Name: 愛德資訊系統
* Plugin URI:
* Author: 饒裕奇
* Author URI:
* Version: 0.0.1
* Description: 結合社工與志工的資料庫
* License
* Text Domain: lca_docs
**/
?>
<?php
/**
* 建立 CPT lca_new_cpt_formal_docs
*
* 建立包含公文收文及發文摘要文件
*
**/
function lca_new_cpt_formal_docs() {
$post_type = 'formal_docs';
$labels = array(
'name' => _x( '公文總覽', '', ''),
'singular_name' => _x( '公文摘要', '', ''),
'menu_name' => __( '公文彙整系統', '' ),
'add_new' => __( '新增公文', '' ),
'add_new_item' => __( '新增公文摘要', '' ),
'edit_item' => __( '編輯公文摘要', '' ),
'view_all' => __( '檢視公文', '' ),
'search_items' => __( '搜尋公文摘要', '' ),
'not_found' => __( '沒有找到符合條件的公文摘要', '' ),
'not_found_in_trash' => __( '沒有在回收筒中找到符合條件的公文摘要', '' ),
);
$args = array
'public' => true,
'show_ui' => true,
'show_in_menu' => '',
'show_in_admin_bar' => true,
'has_archive' => true,
'capability_type' => 'formal_doc',
'menu_icon' => 'dashicons-media-document',
'description' => '提供公文摘要輸入與查詢',
'publicly_queriable' => true,
'query_var' => true,
'hierarchical' => false,
);
register_post_type( $post_type, $args );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.