Download the PHP package hamworks/wp-post-type without Composer
On this page you can find all versions of the php package hamworks/wp-post-type. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package wp-post-type
hamworks/wp-post-type
WordPressのカスタム投稿タイプを簡単に作成するためのライブラリです。
インストール
基本的な使い方
詳細設定
オプションの設定
ラベルのカスタマイズ
デフォルト設定
このライブラリでは以下のデフォルト設定が適用されます:
基本設定
public
: trueshow_ui
: trueshow_in_rest
: true(REST API対応)show_in_admin_bar
: trueshow_in_nav_menus
: truehas_archive
: truehierarchical
: false
サポート機能
- title(タイトル)
- author(投稿者)
- editor(エディター)
- excerpt(抜粋)
- revisions(リビジョン)
- thumbnail(アイキャッチ画像)
- custom-fields(カスタムフィールド)
GraphQL対応
- WPGraphQL使用時に自動でGraphQLフィールド名を設定
- 単数形と複数形のslugが自動生成される
URL書き換え
- Doctrine Inflectorを使用してslugを自動生成
- 複数形のslugが自動設定される(例:
book
→books
)
階層化投稿タイプ
hierarchical
を true
に設定すると、自動的に page-attributes
サポートが追加され、管理画面でのデフォルトソート順が menu_order
になります。
使用例
イベント投稿タイプの作成
階層化されたページ型投稿タイプの作成
メソッド
__construct( $name, $label )
$name
: 投稿タイプのスラッグ(単数形で指定)$label
: 表示名
set_options( array $args = [] )
投稿タイプのオプションを設定します。WordPressの register_post_type()
と同じ引数を使用できます。
set_labels( array $args = [] )
投稿タイプのラベルを設定します。
create()
投稿タイプを登録し、必要なフックを追加します。
get_post_type()
登録された投稿タイプオブジェクトを返します。
All versions of wp-post-type with dependencies
PHP Build Version
Package Version
Requires
doctrine/inflector Version
^2.0
The package hamworks/wp-post-type contains the following files
Loading the files please wait ....