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
850
俺のフックが名古屋でもこんなに簡単なわけがない。
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
38
Introducing concrete5 PWA add-on (Japanese)
hissy
0
1.3k
Mautic Glossary (ja) 2019
hissy
1
150
CMS導入プロジェクトを成功させるために 押さえておくべき5つの手順
hissy
4
1.1k
Mautic Glossary (ja)
hissy
1
890
Mautic Updates 2016-09
hissy
0
870
MauticSummerGamesTokyo
hissy
1
510
Mautic Updates 2016-07
hissy
0
390
CMS for the future
hissy
4
3.8k
Other Decks in Technology
See All in Technology
30代エンジニアが考える、エンジニア生存戦略~~セキュリティを添えて~~
masakiokuda
4
2k
コンソールで学ぶ!AWS CodePipelineの機能とオプション
umekou
2
120
SaaSプロダクト開発におけるバグの早期検出のためのAcceptance testの取り組み
kworkdev
PRO
0
460
数百台のオンプレミスのサーバーをEKSに移行した話
yukiteraoka
0
680
Multitenant 23ai の全貌 - 機能・設計・実装・運用からマイクロサービスまで
oracle4engineer
PRO
2
120
チームビルディング「脅威モデリング」ワークショップ
koheiyoshikawa
0
150
LINE Notify互換のボットを作った話
kenichirokimura
0
180
バクラクでのSystem Risk Records導入による変化と改善の取り組み/Changes and Improvement Initiatives Resulting from the Implementation of System Risk Records
taddy_919
0
220
SSH公開鍵認証による接続 / Connecting with SSH Public Key Authentication
kaityo256
PRO
2
220
Amazon GuardDuty Malware Protection for Amazon S3を使おう
ryder472
2
110
問題解決に役立つ数理工学
recruitengineers
PRO
7
2.3k
Agile TPIを活用した品質改善事例
tomasagi
0
350
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
48
7.6k
Done Done
chrislema
183
16k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
12
610
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
31
4.8k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Into the Great Unknown - MozCon
thekraken
36
1.7k
The Language of Interfaces
destraynor
157
24k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Fireside Chat
paigeccino
37
3.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