Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
俺のフックが名古屋でもこんなに簡単なわけがない。
Search
Takuro Hishikawa
August 31, 2013
Technology
2
840
俺のフックが名古屋でもこんなに簡単なわけがない。
WordPressのフィルターフック、アクションフックの動作原理と使い方を実例多めに解説した資料です。
Takuro Hishikawa
August 31, 2013
Tweet
Share
More Decks by Takuro Hishikawa
See All by Takuro Hishikawa
Mautic Meetup Tokyo #8 Mautic 3 is coming! (Japanese)
hissy
0
33
Introducing concrete5 PWA add-on (Japanese)
hissy
0
1.2k
Mautic Glossary (ja) 2019
hissy
1
140
CMS導入プロジェクトを成功させるために 押さえておくべき5つの手順
hissy
4
1.1k
Mautic Glossary (ja)
hissy
1
860
Mautic Updates 2016-09
hissy
0
850
MauticSummerGamesTokyo
hissy
1
490
Mautic Updates 2016-07
hissy
0
370
CMS for the future
hissy
4
3.8k
Other Decks in Technology
See All in Technology
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
120
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
390
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
520
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
170
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
190
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
220
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.6k
普通のエンジニアがLaravelコアチームメンバーになるまで
avosalmon
0
110
Featured
See All Featured
Navigating Team Friction
lara
183
15k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
We Have a Design System, Now What?
morganepeng
51
7.3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Building an army of robots
kneath
302
44k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Transcript
໊ݹ Ͱ ԶͷϑοΫ͕͜Μͳʹ ؆୯ͳΘ͚͕ͳ͍ɻ ԶͷϑοΫ͕͜Μͳʹ ؆୯ͳΘ͚͕ͳ͍ɻ ore no hook ga
konna ni kantan na wakega nai. 8PSE'FT/BHPZB !)JTTZ/$ 1
͜Μͳઆ໌Έͨ͜ͱ͋Γ·ͤΜ͔ʁ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ൈਮͷ<>Λফ͢ʹɺGVODUJPOTQIQʹҎԼͷίʔυΛ
ίϐʔˍϖʔετ͠·͠ΐ͏ɻ 2
͜Εɺ࣮ʮϑοΫʯͱ͍͍·͢ɻ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ൈਮͷ<>Λফ͢ʹɺGVODUJPOTQIQʹҎԼͷίʔυΛ
ίϐʔˍϖʔετ͠·͠ΐ͏ɻ 3
ϑοΫͷதͰ͜ΕʮϑΟϧλʔϑοΫʯ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ൈਮͷ<>Λফ͢ʹɺGVODUJPOTQIQʹҎԼͷίʔυΛ
ίϐʔˍϖʔετ͠·͠ΐ͏ɻ 4
ࠓʮϑοΫʯͷ͘͠Έʹ͍ͭͯͷ͓ɻ 5
ϑοΫʹ̎ͭ͋Δɻ ΞΫγϣϯϑοΫ ϑΟϧλʔϑοΫ 6
8PSE1SFTTΛྉཧͩͱ ߟ͑ͯΈ·͠ΐ͏ 7
8PSE1SFTTͷॲཧ Ϩγϐ௨Γ࡞ΒΕΔ ྉཧͷΑ͏ͳͷ 8
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ 9
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ શͯͷॲཧʹॱ൪͕͋Γ·͕͢ɺ ͦΕͧΕಠཱ͍ͯ͠·͢ɻ 10
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ ༹͖ཛΛՃ͑Δɻ ॲཧΛՃ 11
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ ༹͖ཛΛՃ͑Δɻ ॲཧΛՃ ΞΫγϣϯϑοΫ 12
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ ༹͖ཛΛՃ͑Δɻ Ͳ͜ʹՃ͔ͨ͠ʁ 13
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ ༹͖ཛΛՃ͑Δɻ ʮ;ΜΘΓ͢Δ·Ͱ ࠞͥͨޙʯ 14
ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); 15
ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ॲཧΛՃ͢Δ ॴΛࢦఆͯ͠ʜ
16
ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ࣮ߦ͢ΔॲཧΛ ໊ؔͰࢦఆ
17
ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ϑοΫʹՃ͑Δ ॲཧؔʢGVODUJPOʣͰॻ͖·͢
18
ͳͥ͜ΜͳΊΜͲ͍͘͞ ͜ͱΛ͢Δͷ͔ʁ 19
Ϩγϐιʔείʔυ Ξοϓσʔτ͞ΕΔɻ ॻ͖͑ͯ͠·͏ͱ͋ͱ ͰͲ͜Λฤू͔ͨ͠Θ͔Β ͳ͘ͳΔɻ 20
ΧελϚΠζϑοΫͰߦ͏ͷ͕ݪଇɻ ςϯϓϨʔτʹॻ͍ͯ͠·͏ͱɺςʔϚ Λม͑ͨ࣌ʹॲཧ͕ফ͑ͯ͠·͏ɻ 8FC੍࡞ऀ͠͠αΠτͷςʔϚมΘ Βͳ͍ͷͩͱࢥ͏͕ɺҰԠಛघͳྫͰຊདྷ Ϣʔβʔ͕ม͑Δͷ 21
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ 22
όλʔHΛࠞͥΔɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ Ϩγϐͷதʹෳͷॲཧʹ ڞ௨ͨ͠ಈ࡞͕͋Γ·͢ɻ 23
όλʔHΛΑࠞͥ͘Δɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ ʮࠞͥΔʯΛ ʮΑࠞͥ͘Δʯʹ ϑΟϧλʔΛ͔͚ͨ 24
όλʔHΛΑࠞͥ͘Δɻ ࠭HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ ʮࠞͥΔʯΛ ʮΑࠞͥ͘Δʯʹ ϑΟϧλʔΛ͔͚ͨ ϑΟϧλʔϑοΫ
25
ϑΟϧλʔϑοΫΛॻ͍ͯΈͨ function ࠞͥΔʹΑ͘Λ͢ ($text) { return ‘Α͘’ . $text; }
add_filter('ࠞͥΔ', 'ࠞͥΔʹ Α͘Λ͢'); 26
όλʔHΛΑࠞͥ͘Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ ʮ࠭HΛՃ͑Δʯ Λॲཧ͠ͳ͍ 27
όλʔHΛΑࠞͥ͘Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ ʮ࠭HΛՃ͑Δʯ Λॲཧ͠ͳ͍ ͜ΕϑΟϧλʔϑοΫ 28
ϑΟϧλʔϑοΫΛॻ͍ͯΈͨ function Ί͓ͯ͘() { return false; } add_filter('࠭ΛՃ͑Δ͔Ͳ͏ ͔', 'Ί͓ͯ͘');
29
ΞΫγϣϯϑοΫͷ͓͞Β͍ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ͋͘·ͰॲཧͷՃɻ 30
ϑΟϧλʔϑοΫͷ͓͞Β͍ function ࠞͥΔʹΑ͘Λ͢ ($text) { return ‘Α͘’ . $text; }
add_filter('ࠞͥΔ', 'ࠞͥΔʹ Α͘Λ͢'); ͋͘·Ͱطଘͷॲཧͷมߋɻ 31
ΞΫγϣϯϑοΫجຊతʹ طଘͷॲཧͷมߋͰ͖ͳ͍ɻ ϑΟϧλʔϑοΫجຊతʹॲཧࣗମΛ Ճ͢Δ͜ͱͰ͖ͳ͍ɻ 32
ͨͩ͠ɺྫ֎ʜ άϩʔόϧมΛ͑ΞΫγϣϯϑΟ ϧλʔͰطଘͷॲཧͷ݁ՌΛมߋͨ͠ ΓϑΟϧλʔ͢Δ͜ͱ͕Ͱ͖Δɻ άϩʔόϧมςʔϚϓϥάΠϯΛ·͍ͨͰ 8PSE1SFTTͷॲཧதͰڞ௨Ͱ༻Ͱ͖Δม QPTU XQ@RVFSZ XQ@SFXSJUFͳͲ ҰԠɺมΛͯ͠ϑΟϧλʔͷΑ͏ʹ͑ͯ͠·͏ʜʢ͍͜͠ʣ
33
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); 34
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔϑοΫͷొ
35
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔΛ࣮ߦ͢Δ
໊ؔ 36
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔΛ࣮ߦ͢Δ
ؔ 37
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ԿΒ͔ͷΛड͚औͬͯʜ
38
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ۭͷจࣈྻΛฦ͍ͯ͠Δ
39
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ͜ͷNPSF
ԿʹΘΕͯΔͷʜ 40
ιʔεΛಡΉ͔͠ͳ͍ʂ 41
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑοΫΛొ͢Δॲཧ໊
42
಄ͷίʔυΛ͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); BQQMZ@pMUFST
FYDFSQU@NPSF Ͱ8PSE1SFTTͷιʔείʔυΛݕࡧʂ 43
8PSE1SFTTίΞϑΝΠϧͷ֘ͷίʔυ function wp_trim_excerpt($text = '') { $raw_excerpt = $text; if
( '' == $text ) { $text = get_the_content(''); $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $excerpt_length = apply_filters('excerpt_length', 55); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } wp-includes/formatting.phpʢൈਮʣ 44
8PSE1SFTTίΞϑΝΠϧͷ֘ͷίʔυ function wp_trim_excerpt($text = '') { $raw_excerpt = $text; if
( '' == $text ) { $text = get_the_content(''); $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $excerpt_length = apply_filters('excerpt_length', 55); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } BQQMZ@pMUFST ϑΟϧλʔΛ͔͚Δ wp-includes/formatting.phpʢൈਮʣ 45
8PSE1SFTTίΞϑΝΠϧͷ֘ͷίʔυ function wp_trim_excerpt($text = '') { $raw_excerpt = $text; if
( '' == $text ) { $text = get_the_content(''); $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $excerpt_length = apply_filters('excerpt_length', 55); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } ઌ΄ͲͷNPSFͷத͕໌ɻ ֯εϖʔε <>ͩͬͨɻ wp-includes/formatting.phpʢൈਮʣ 46
಄ͷίʔυʹ͖ͬͯ·ͨ͠ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ͭ·Γ͜ͷNPSF
bbb<>`ͱ͍͏จࣈྻͰͨ͠ 47
಄ͷίʔυʹ͖ͬͯ·ͨ͠ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔϑοΫΛͬͯ
ۭͷจࣈྻΛฦ͢͜ͱͰʜ 48
8PSE1SFTTίΞϑΝΠϧͷ֘ͷίʔυ function wp_trim_excerpt($text = '') { $raw_excerpt = $text; if
( '' == $text ) { $text = get_the_content(''); $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $excerpt_length = apply_filters('excerpt_length', 55); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } ίΞϑΝΠϧதͷFYDFSQU@NPSFʹ ೖ͞ΕΔ͕มΘΔ wp-includes/formatting.phpʢൈਮʣ 49
ʜʜ͍͖ͯͯΔ͔ʔͬʂʁ 50
Ͱ͞Βʹ࣮ફฤɻ 51
8PSE1SFTTͷΧςΰϦʔΟδΣοτ ฒͼॱΛม͍͑ͨͳ͊ʜ 52
ฒͼॱͷઃఆ͕ͳ͍ʜ 53
ͯ͜͜͞Ͱ࣭ɻ ΧςΰϦʔΟδΣοτ͕දࣔ͢Δ ΧςΰϦʔͷฒͼॱΛม͍͑ͨɻ ͜ΕΞΫγϣϯϑοΫʁ ϑΟϧλʔϑοΫʁ 54
֘෦ͷίʔυ /** * Categories widget class * * @since 2.8.0
*/ class WP_Widget_Categories extends WP_Widget { ... ! ! $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); ... ! ! <ul> <?php ! ! $cat_args['title_li'] = ''; ! ! wp_list_categories(apply_filters('widget_categories_args', $cat_args)); ?> ! ! </ul> ... wp-includes/default-widget.phpʢൈਮʣ 55
֘෦ͷίʔυ /** * Categories widget class * * @since 2.8.0
*/ class WP_Widget_Categories extends WP_Widget { ... ! ! $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); ... ! ! <ul> <?php ! ! $cat_args['title_li'] = ''; ! ! wp_list_categories(apply_filters('widget_categories_args', $cat_args)); ?> ! ! </ul> ... XQ@MJTU@DBUFHPSJFT ؔͰ ΧςΰϦʔͷҰཡΛग़ྗͯ͠ΔΑ͏ͩɻ wp-includes/default-widget.phpʢൈਮʣ 56
֘෦ͷίʔυ /** * Categories widget class * * @since 2.8.0
*/ class WP_Widget_Categories extends WP_Widget { ... ! ! $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); ... ! ! <ul> <?php ! ! $cat_args['title_li'] = ''; ! ! wp_list_categories(apply_filters('widget_categories_args', $cat_args)); ?> ! ! </ul> ... ΦϓγϣϯDBU@BSHTʹ ϑΟϧλʔΛ௨ͯ͋͠Δʂ ͜ΕͰฒͼॱมߋͰ͖ͦ͏ɻ wp-includes/default-widget.phpʢൈਮʣ 57
֘෦ͷίʔυ /** * Categories widget class * * @since 2.8.0
*/ class WP_Widget_Categories extends WP_Widget { ... ! ! $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); ... ! ! <ul> <?php ! ! $cat_args['title_li'] = ''; ! ! wp_list_categories(apply_filters('widget_categories_args', $cat_args)); ?> ! ! </ul> ... ΦϓγϣϯDBU@BSHT ྻͳΜͩͳɻ ฒͼॱ໊લॱʹͳ͍ͬͯΔͳɻ wp-includes/default-widget.phpʢൈਮʣ 58
֘෦ͷίʔυ /** * Categories widget class * * @since 2.8.0
*/ class WP_Widget_Categories extends WP_Widget { ... ! ! $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); ... ! ! <ul> <?php ! ! $cat_args['title_li'] = ''; ! ! wp_list_categories(apply_filters('widget_categories_args', $cat_args)); ?> ! ! </ul> ... ϑΟϧλʔ໊ ʮXJEHFU@DBUFHPSJFT@BSHTʯ͔ɻ wp-includes/default-widget.phpʢൈਮʣ 59
GVODUJPOTQIQʹهࡌ͢Δίʔυ function change_widget_category_orderby( $cat_args ) { $cat_args['orderby'] = 'count'; $cat_args['order']
= 'DESC'; return $cat_args; } add_filter( 'widget_categories_args', 'change_widget_category_orderby' ); 60
GVODUJPOTQIQʹهࡌ͢Δίʔυ function change_widget_category_orderby( $cat_args ) { $cat_args['orderby'] = 'count'; $cat_args['order']
= 'DESC'; return $cat_args; } add_filter( 'widget_categories_args', 'change_widget_category_orderby' ); XQ@MJTU@DBUFHPSJFT ͷ ΦϓγϣϯΛྻͰड͚औͬͯʜ ˢ ͜Ε͕ιʔεΛಡ·ͳ͍ͱ͔Βͳ͍ 61
GVODUJPOTQIQʹهࡌ͢Δίʔυ function change_widget_category_orderby( $cat_args ) { $cat_args['orderby'] = 'count'; $cat_args['order']
= 'DESC'; return $cat_args; } add_filter( 'widget_categories_args', 'change_widget_category_orderby' ); มߋ͍ͨ͠ΦϓγϣϯΛ ઃఆͯ͠ʜ ˢ ͬͪ͜$PEFYͷXQ@MJTU@DBUFHPSJFTͷ ϖʔδΛݟͳ͍ͱ͔Βͳ͍ 62
GVODUJPOTQIQʹهࡌ͢Δίʔυ function change_widget_category_orderby( $cat_args ) { $cat_args['orderby'] = 'count'; $cat_args['order']
= 'DESC'; return $cat_args; } add_filter( 'widget_categories_args', 'change_widget_category_orderby' ); ฦ͢ 63
Ͱ͖ͨʂ ΧςΰϦʔͷ ߘॱ ߱ॱ 64
͜ͷΑ͏ʹɺϑΟϧλʔϑοΫ ϑΟϧλʔ͞ΕΔ͕ͲΜͳͰ ϑΟϧλʔϑοΫͰฦ͕ͨ͠ ͦͷޙͲͷΑ͏ʹΘΕΔͷ͔ɺ ϑοΫʹΑͬͯҟͳΔ͠ɺ ιʔεΛݟͳ͍ͱ͔Βͳ͍ɻ 65
͞ΒʹɺΞΫγϣϯϑοΫ 8PSE1SFTT͕ͲΜͳॱ൪Ͱ ԿΛॲཧ͍ͯ͠Δͷ͔ɺ ͋ΔఔΘ͔ͬͯͳ͍ͱ Ͳ͜ʹϑοΫ͍͍ͯ͠ͷ͔ ͔Βͳ͍ɻ 66
͑ʁ݁ہ ͍͠͡Όͳ͍͔ͬͯʜʁ ? 67
ԶͷϑοΫ ͕ͦΜͳʹ ؆୯ͳΘ͚͕ͳ͍ʂ ԶͷϑοΫ ͕ͦΜͳʹ ؆୯ͳΘ͚͕ͳ͍ʂ 68
ϑΟϧλʔϑοΫͷσόοάʹ %FCVH#BS&YUFOEFSϓϥάΠϯͷ 7BSJBCMF-PPLVQػೳ͕ศར IUUQXPSEQSFTTPSHFYUFOEQMVHJOTEFCVHCBSFYUFOEFS Ͱ ΞΫγϣϯϑοΫͱϑΟϧλʔϑοΫͷ ҧ͍ɺجຊతͳߟ͑ํΛ͓͚ͬͯ ͦΜͳʹා͘ͳ͍Αʂ 69
Ͱ࠷ޙʹ࿅शɻ 70
XQMPHJOQIQΛΧελϚΠζͯ͠ΈΑ͏ XQMPHJOQIQϩάΠϯը໘ ݟͨΛΧελϚΠζͰ͖Δ֤छͷ ΞΫγϣϯˍϑΟϧλʔϑοΫ͕͋Δ ͙͢ʹ֬ೝͰ͖Δ͠Өڹൣғগͳ͍ͷ Ͱ࿅श͖ 71
XQMPHJOQIQͷϑΟϧλʔϑοΫ $login_header_url = __( 'http://wordpress.org/' ); ... $login_header_url = apply_filters(
'login_headerurl', $login_header_url ); ... <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1> wp-login.phpʢൈਮʣ 72
XQMPHJOQIQͷϑΟϧλʔϑοΫ $login_header_url = __( 'http://wordpress.org/' ); ... $login_header_url = apply_filters(
'login_headerurl', $login_header_url ); ... <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1> wp-login.phpʢൈਮʣ มMPHJO@IFBEFS@VSMʹ 8PSE1SFTTެࣜαΠτͷ63-͕ ֨ೲ͞Ε͍ͯΔ ʢ༁ϑΝΠϧʹΑ࣮ͬͯࡍʹ KBXPSEQSFTTPSHʹͳΔʣ 73
XQMPHJOQIQͷϑΟϧλʔϑοΫ $login_header_url = __( 'http://wordpress.org/' ); ... $login_header_url = apply_filters(
'login_headerurl', $login_header_url ); ... <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1> wp-login.phpʢൈਮʣ มMPHJO@IFBEFS@VSMʹ ϑΟϧλʔ͕ద༻͞Ε͍ͯΔ 74
XQMPHJOQIQͷϑΟϧλʔϑοΫ $login_header_url = __( 'http://wordpress.org/' ); ... $login_header_url = apply_filters(
'login_headerurl', $login_header_url ); ... <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1> wp-login.phpʢൈਮʣ มMPHJO@IFBEFS@VSM͕ ΘΕ͍ͯΔͷϩάΠϯ ϑΥʔϜͷϩΰͷϦϯΫઌ 75
GVODUJPOTQIQ͔ΒϦϯΫઌΛม͑ͯΈΑ͏ function change_login_headerurl( $login_headerurl ) { ! return 'http://2013.wordfes.org/'; }
add_filter( 'login_headerurl', 'change_login_headerurl' ); 76
XQMPHJOQIQͷΞΫγϣϯϑοΫ <?php do_action('login_footer'); ?> wp-login.phpʢൈਮʣ ΞΫγϣϯϑοΫ͕࣮ߦ͞ΕΔͷ EP@BDUJPOؔ ॲཧͷʮՃʯͳͷͰɺ طଘͷΛ͏͜ͱͳ͘ γϯϓϧͰ͢Ͷɻ
77
XQMPHJOQIQͷΞΫγϣϯϑοΫ function login_footer_message() { ! echo '<h1 style="text- align:center">ͭͳ͕Ζ·͍ʂ</h1>'; }
add_action( 'login_footer', 'login_footer_message' ); ϝοηʔδΛՃͯ͠Έͨ 78
࿅शɿϩάΠϯΤϥʔϝοηʔδ echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n"; wp-login.phpʢൈਮʣ
ΤϥʔϝοηʔδͷʮɻʯΛ ʮὑʯʹม͑ͯΈ·͠ΐ͏ʂ ղͪ͜Β IUUQTHJTUHJUIVCDPNIJTTZ DGCB 79
ϑοΫ͕ා͘ͳ͘ͳ͔ͬͨͳʁʁ 80
ϑοΫʹؔ͢ΔϒϩάΛ৭ʑΞοϓͯ͠·͢ɻ ϑΟϧλʔϑοΫɿΧελϜϝχϡʔͷ߲ʹ༩͞ΕΔΫϥεΛΧελϚΠζ͢Δ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ϑΟϧλʔϑοΫɿݕࡧ݁ՌͰߘλΠϓ͝ͱʹҧ͏ςϯϓϨʔτϑΝΠϧΛ͏ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ΞΫγϣϯϑοΫɿςʔϚ͔Β+BWBTDSJQU$44ΛಡΈࠐΉॻ͖ํ·ͱΊ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ΞΫγϣϯϑοΫɿπʔϧόʔΛΧελϚΠζ͢Δ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ΞΫγϣϯϑοΫɿύϯͣ͘φϏήʔγϣϯʢ#SFBEDSVNC/BW95ʣΛΧελϚΠζ͢Δ
IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ϑΟϧλʔϑοΫɿΪϟϥϦʔΛΧελϚΠζ͖ͯ͠ͳK2VFSZϓϥάΠϯΛ͏ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT 81
5IBOLT 82