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
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
31k
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
160
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
420
Storage Browser for Amazon S3
miu_crescent
1
120
podman_update_2024-12
orimanabu
1
260
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
160
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
8
3.2k
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
150
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
20241220_S3 tablesの使い方を検証してみた
handy
3
190
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
270
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
GraphQLとの向き合い方2022年版
quramy
44
13k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Producing Creativity
orderedlist
PRO
341
39k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Making Projects Easy
brettharned
116
5.9k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
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