Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
俺のフックが名古屋でもこんなに簡単なわけがない。
Search
Takuro Hishikawa
August 31, 2013
Technology
2
830
俺のフックが名古屋でもこんなに簡単なわけがない。
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
32
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
840
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
日本全国・都市3D化プロジェクト「PLATEAU」とデータ変換OSS「PLATEAU GIS Converter」の公開
nokonoko1203
4
370
2024年のModern Data Stackを振り返ろう~分野別の目玉アップデート情報まとめ~
sagara
0
320
プロセス改善とE2E自動テストによる、プロダクトの品質向上事例
tomasagi
1
3.8k
Ruby on Browser - RubyWorld Conference 2024
tmtms
1
110
Kaggleふりかえり会〜LLM 20 Questions & ISIC 2024
recruitengineers
PRO
2
180
12/4(水)のBedrockアプデ速報(re:Invent 2024 Daily re:Cap #3 with AWS Heroes)
minorun365
PRO
2
420
Autonomous Database サービス・アップデート (FY25)
oracle4engineer
PRO
0
270
職能を超えたモブプログラミングが品質に与えた良い影響
tonionagauzzi
1
190
深層学習のリペア技術の最新動向と実際 / DNN Repair Techniques for AI Performance Alignment for Safety Requirements
ishikawafyu
0
490
開発者向けツールを魔改造してセキュリティ診断ツールを作っている話 - 第1回 セキュリティ若手の会 LT
pizzacat83
0
390
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 @ AXIES 2024
ritou
2
700
My Generation 年配者がこの先生きのこるには (Developers CAREER Boost 2024 Edition)/My Generation How elder engineers can survive
kwappa
3
370
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
4 Signs Your Business is Dying
shpigford
181
21k
A designer walks into a library…
pauljervisheath
204
24k
BBQ
matthewcrist
85
9.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
43
9.3k
Bash Introduction
62gerente
608
210k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
KATA
mclloyd
29
14k
Unsuck your backbone
ammeep
669
57k
Into the Great Unknown - MozCon
thekraken
33
1.5k
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