Upload
hitoshi-omagari
View
2.302
Download
0
Embed Size (px)
Citation preview
P r i m e S t r a t e g y C o . , L t d . W o r d P r e s s I n t e g r a t i o n D i v i s i o n
3
1.自己紹介
大曲 仁 自己紹介
5
t @jim0912 f hitoshi.omagari
• WordPress 日本語フォーラム 世話役
• WordCamp スピーカー
• WordPress 4.4 コアコントリビューター
執筆監訳書籍
7
(出版社:ソフトバンク クリエイティブ株式会社他)
WordPressの教科書 シリーズ
Amazon総合ランキング1位獲得 日本、韓国で累計4万部突破。
(出版社:株式会社オライリー・ジャパン)
WordPressによるWebアプリケーション開発 詳解 WordPress
P r i m e S t r a t e g y C o . , L t d . W o r d P r e s s I n t e g r a t i o n D i v i s i o n
15
2.Rewrite Endpoint とは
Make WordPress Plugins – Rewrite endpoints API https://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
16
Make WordPress Plugins – Rewrite endpoints API https://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
17
エンドポイントとは
エンドポイントを使うと、通常のWordPressのURLの最後にち
ょっとした追加を簡単に行うことができます。
例えば、エンドポイントを使って、全ての投稿のURLの後に「
gallery」を追加し、投稿に使われている全ての画像を表示する
といったことが可能です。
例)http://example.com/my-fantastic-post/gallery/
18
エンドポイントとは
エンドポイントを使うと、通常のWordPressのURLの最後にち
ょっとした追加を簡単に行うことができます。
例えば、エンドポイントを使って、全ての投稿のURLの後に「
gallery」を追加し、投稿に使われている全ての画像を表示する
といったことが可能です。
例)http://example.com/my-fantastic-post/gallery/
19
WordPress のリライトエンドポイント例
http://example.com/category/uncategorized/page/3/
http://example.com/post_name/cpage/2/
http://example.com/feed/
20
リライトエンドポイントで追加されたURL
P r i m e S t r a t e g y C o . , L t d . W o r d P r e s s I n t e g r a t i o n D i v i s i o n
21
2.Rewrite Endpoint の活用
施設系検索サイトのあるある構成
24
基本情報 写真
photo
レビュー
review
マップ
map
検索 条件入力
検索結果
シングルページに
・photo
・review
・map
のエンドポイントを追加して表示
P r i m e S t r a t e g y C o . , L t d . W o r d P r e s s I n t e g r a t i o n D i v i s i o n
25
3.Rewrite Endpoint の落とし穴
P r i m e S t r a t e g y C o . , L t d . W o r d P r e s s I n t e g r a t i o n D i v i s i o n
28
3.Rewrite Endpoint の作り方
1. エンドポイント名(スラッグ)
2. エンドポイントを追加する場所
3. クエリ変数(デフォルト:エンドポイント名)
※ リライトルールの再生成を忘れずに
と指定するのですが。。
30
add_rewrite_endpoint
/) ///) /,.=゙‘’“/ / i f,.r=‘”-‐’つ____ / / _,.-‐‘~/⌒ ⌒\ / ,i ,二ニ⊃( ●). (●)\ / ノ il゙フ::::::⌒(__人__)⌒::::: \ ,イ「ト、 ,!,!| |r┬-| | / iトヾヽ_/ィ"\ `ー'´ /
31
色々と小難しいので。。
エンドポイントを管理画面で作れる
プラグイン作りました。
32
https://ja.wordpress.org/plugins/rewrite-endpoint-master/
エンドポイントを管理画面で作れる
プラグイン作りました。
33
https://ja.wordpress.org/plugins/rewrite-endpoint-master/
ただし勢いで
リライトエンドポイント参考URL
Rewrite APIその2 WordPressでアプリを作る基本(WordPressプラグイン開発のバイブルのボツ原稿から)
http://nskw-style.com/2014/wordpress/wordpress-app-with-rewrite-api.html
WordPressに独自のURLを追加する。2014年版
https://firegoby.jp/archives/5309
Rewrite endpoints API
https://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Rewrite API/add rewrite endpoint
https://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint
WordPress Rewrite API – Part 3
https://pippinsplugins.com/wordpress-rewrite-api-part-3/
A (Mostly) Complete Guide to the WordPress Rewrite API
https://www.pmg.com/blog/a-mostly-complete-guide-to-the-wordpress-rewrite-api/
45