Save 37% off PRO during our Black Friday Sale! »

俺のフックが名古屋でもこんなに簡単なわけがない。

 俺のフックが名古屋でもこんなに簡単なわけがない。

WordPressのフィルターフック、アクションフックの動作原理と使い方を実例多めに解説した資料です。

75e55614a2d05d8c7784779e76a1a3d9?s=128

Takuro Hishikawa

August 31, 2013
Tweet

Transcript

  1. ໊ݹ԰ Ͱ΋ ԶͷϑοΫ͕͜Μͳʹ ؆୯ͳΘ͚͕ͳ͍ɻ ԶͷϑοΫ͕͜Μͳʹ ؆୯ͳΘ͚͕ͳ͍ɻ ore no hook ga

    konna ni kantan na wakega nai. 8PSE'FT/BHPZB !)JTTZ/$ 1
  2. ͜Μͳઆ໌Έͨ͜ͱ͋Γ·ͤΜ͔ʁ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ൈਮͷ<>Λফ͢ʹ͸ɺGVODUJPOTQIQʹҎԼͷίʔυΛ

    ίϐʔˍϖʔετ͠·͠ΐ͏ɻ 2
  3. ͜Εɺ࣮͸ʮϑοΫʯͱ͍͍·͢ɻ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ൈਮͷ<>Λফ͢ʹ͸ɺGVODUJPOTQIQʹҎԼͷίʔυΛ

    ίϐʔˍϖʔετ͠·͠ΐ͏ɻ 3
  4. ϑοΫͷதͰ΋͜Ε͸ʮϑΟϧλʔϑοΫʯ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ൈਮͷ<>Λফ͢ʹ͸ɺGVODUJPOTQIQʹҎԼͷίʔυΛ

    ίϐʔˍϖʔετ͠·͠ΐ͏ɻ 4
  5. ࠓ೔͸ʮϑοΫʯͷ͘͠Έʹ͍ͭͯͷ͓࿩ɻ 5

  6. ϑοΫʹ͸̎ͭ͋Δɻ ΞΫγϣϯϑοΫ ϑΟϧλʔϑοΫ 6

  7. 8PSE1SFTTΛྉཧͩͱ ߟ͑ͯΈ·͠ΐ͏ 7

  8. 8PSE1SFTTͷॲཧ͸ Ϩγϐ௨Γ࡞ΒΕΔ ྉཧͷΑ͏ͳ΋ͷ 8

  9. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  9

  10. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  શͯͷॲཧʹ͸ॱ൪͕͋Γ·͕͢ɺ ͦΕͧΕ͸ಠཱ͍ͯ͠·͢ɻ 10

  11. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  ༹͖ཛΛՃ͑Δɻ ॲཧΛ௥Ճ 11

  12. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  ༹͖ཛΛՃ͑Δɻ ॲཧΛ௥Ճ ΞΫγϣϯϑοΫ  12

  13. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  ༹͖ཛΛՃ͑Δɻ Ͳ͜ʹ௥Ճ͔ͨ͠ʁ 13

  14. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  ༹͖ཛΛՃ͑Δɻ ʮ;ΜΘΓ͢Δ·Ͱ ࠞͥͨޙʯ 14

  15. ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); 15

  16. ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ॲཧΛ௥Ճ͢Δ ৔ॴΛࢦఆͯ͠ʜ

    16
  17. ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ࣮ߦ͢ΔॲཧΛ ؔ਺໊Ͱࢦఆ

    17
  18. ΞΫγϣϯϑοΫΛॻ͍ͯΈͨ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ϑοΫʹՃ͑Δ ॲཧ͸ؔ਺ʢGVODUJPOʣͰॻ͖·͢

    18
  19. ͳͥ͜ΜͳΊΜͲ͍͘͞ ͜ͱΛ͢Δͷ͔ʁ 19

  20. Ϩγϐιʔείʔυ͸ Ξοϓσʔτ͞ΕΔɻ ॻ͖׵͑ͯ͠·͏ͱ͋ͱ ͰͲ͜Λฤू͔ͨ͠Θ͔Β ͳ͘ͳΔɻ 20

  21. ΧελϚΠζ͸ϑοΫͰߦ͏ͷ͕ݪଇɻ ςϯϓϨʔτʹॻ͍ͯ͠·͏ͱɺςʔϚ Λม͑ͨ࣌ʹॲཧ͕ফ͑ͯ͠·͏ɻ 8FC੍࡞ऀ͸͠͹͠͹αΠτͷςʔϚ͸มΘ Βͳ͍΋ͷͩͱࢥ͏͕ɺҰԠಛघͳྫͰຊདྷ ͸Ϣʔβʔ͕ม͑Δ΋ͷ 21

  22. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  22

  23. όλʔHΛࠞͥΔɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰࠞͥΔɻ όχϥΤοηϯεΛՃ͑Δɻ  Ϩγϐͷதʹ͸ෳ਺ͷॲཧʹ ڞ௨ͨ͠ಈ࡞͕͋Γ·͢ɻ 23

  24. όλʔHΛΑࠞͥ͘Δɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ  ʮࠞͥΔʯΛ ʮΑࠞͥ͘Δʯʹ ϑΟϧλʔΛ͔͚ͨ 24

  25. όλʔHΛΑࠞͥ͘Δɻ ࠭౶HΛՃ͑Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ  ʮࠞͥΔʯΛ ʮΑࠞͥ͘Δʯʹ ϑΟϧλʔΛ͔͚ͨ ϑΟϧλʔϑοΫ 

    25
  26. ϑΟϧλʔϑοΫΛॻ͍ͯΈͨ function ࠞͥΔʹΑ͘Λ଍͢ ($text) { return ‘Α͘’ . $text; }

    add_filter('ࠞͥΔ', 'ࠞͥΔʹ Α͘Λ଍͢'); 26
  27. όλʔHΛΑࠞͥ͘Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ  ʮ࠭౶HΛՃ͑Δʯ Λॲཧ͠ͳ͍ 27

  28. όλʔHΛΑࠞͥ͘Δɻ ;ΜΘΓ͢Δ·ͰΑࠞͥ͘Δɻ όχϥΤοηϯεΛՃ͑Δɻ  ʮ࠭౶HΛՃ͑Δʯ Λॲཧ͠ͳ͍ ͜Ε΋ϑΟϧλʔϑοΫ  28

  29. ϑΟϧλʔϑοΫΛॻ͍ͯΈͨ function ΍Ί͓ͯ͘() { return false; } add_filter('࠭౶ΛՃ͑Δ͔Ͳ͏ ͔', '΍Ί͓ͯ͘');

    29
  30. ΞΫγϣϯϑοΫͷ͓͞Β͍ function ༹͖ཛΛՃ͑Δ() { } add_action(';ΜΘΓ͢Δ·Ͱࠞͥ ͨޙ', '༹͖ཛΛՃ͑Δ'); ͋͘·Ͱॲཧͷ௥Ճɻ 30

  31. ϑΟϧλʔϑοΫͷ͓͞Β͍ function ࠞͥΔʹΑ͘Λ଍͢ ($text) { return ‘Α͘’ . $text; }

    add_filter('ࠞͥΔ', 'ࠞͥΔʹ Α͘Λ଍͢'); ͋͘·Ͱطଘͷॲཧͷมߋɻ 31
  32. ΞΫγϣϯϑοΫ͸جຊతʹ طଘͷॲཧͷมߋ͸Ͱ͖ͳ͍ɻ ϑΟϧλʔϑοΫ͸جຊతʹॲཧࣗମΛ ௥Ճ͢Δ͜ͱ͸Ͱ͖ͳ͍ɻ 32

  33. ͨͩ͠ɺྫ֎ʜ άϩʔόϧม਺Λ࢖͑͹ΞΫγϣϯϑΟ ϧλʔͰ΋طଘͷॲཧͷ݁ՌΛมߋͨ͠ ΓϑΟϧλʔ͢Δ͜ͱ͕Ͱ͖Δɻ άϩʔόϧม਺ςʔϚ΍ϓϥάΠϯΛ·͍ͨͰ 8PSE1SFTTͷॲཧதͰڞ௨Ͱ࢖༻Ͱ͖Δม਺ QPTU XQ@RVFSZ XQ@SFXSJUFͳͲ ҰԠɺม਺Λ౉ͯ͠ϑΟϧλʔͷΑ͏ʹ΋࢖͑ͯ͠·͏ʜʢ΍΍͍͜͠ʣ

    33
  34. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); 34

  35. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔϑοΫͷొ࿥

    35
  36. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔΛ࣮ߦ͢Δ

    ؔ਺໊ 36
  37. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔΛ࣮ߦ͢Δ

    ؔ਺ 37
  38. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ԿΒ͔ͷ஋Λड͚औͬͯʜ

    38
  39. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ۭͷจࣈྻΛฦ͍ͯ͠Δ

    39
  40. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ͜ͷNPSF͸

    Կʹ࢖ΘΕͯΔͷʜ 40
  41. ιʔεΛಡΉ͔͠ͳ͍ʂ 41

  42. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑοΫΛొ࿥͢Δॲཧ໊

    42
  43. ๯಄ͷίʔυΛ΋͏͍ͪͲݟͯΈ·͠ΐ͏ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); BQQMZ@pMUFST

    FYDFSQU@NPSF Ͱ8PSE1SFTTͷιʔείʔυΛݕࡧʂ 43
  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(']]>', ']]&gt;', $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
  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(']]>', ']]&gt;', $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
  46. 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(']]>', ']]&gt;', $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
  47. ๯಄ͷίʔυʹ໭͖ͬͯ·ͨ͠ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ͭ·Γ͜ͷNPSF͸

    bbb<>`ͱ͍͏จࣈྻͰͨ͠ 47
  48. ๯಄ͷίʔυʹ໭͖ͬͯ·ͨ͠ function new_excerpt_more($more) { return ''; } add_filter('excerpt_more', 'new_excerpt_more'); ϑΟϧλʔϑοΫΛ࢖ͬͯ

    ۭͷจࣈྻΛฦ͢͜ͱͰʜ 48
  49. 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(']]>', ']]&gt;', $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. ʜʜ෇͍͖ͯͯΔ͔ʔͬʂʁ 50

  51. Ͱ͸͞Βʹ࣮ફฤɻ 51

  52. 8PSE1SFTTͷΧςΰϦʔ΢ΟδΣοτ ฒͼॱΛม͍͑ͨͳ͊ʜ 52

  53. ฒͼॱͷઃఆ͕ͳ͍ʜ 53

  54. ͯ͜͜͞Ͱ࣭໰ɻ ΧςΰϦʔ΢ΟδΣοτ͕දࣔ͢Δ ΧςΰϦʔͷฒͼॱΛม͍͑ͨɻ ͜Ε͸ΞΫγϣϯϑοΫʁ ϑΟϧλʔϑοΫʁ 54

  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> ... wp-includes/default-widget.phpʢൈਮʣ 55
  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> ... XQ@MJTU@DBUFHPSJFT ؔ਺Ͱ ΧςΰϦʔͷҰཡΛग़ྗͯ͠ΔΑ͏ͩɻ wp-includes/default-widget.phpʢൈਮʣ 56
  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ʢൈਮʣ 57
  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> ... Φϓγϣϯ஋DBU@BSHT͸ ഑ྻͳΜͩͳɻ ฒͼॱ͸໊લॱʹͳ͍ͬͯΔͳɻ wp-includes/default-widget.phpʢൈਮʣ 58
  59. ֘౰෦෼ͷίʔυ /** * 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
  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' ); 60
  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' ); XQ@MJTU@DBUFHPSJFT ͷ Φϓγϣϯ஋Λ഑ྻͰड͚औͬͯʜ ˢ ͜Ε͕ιʔεΛಡ·ͳ͍ͱ෼͔Βͳ͍ 61
  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' ); มߋ͍ͨ͠Φϓγϣϯ஋Λ ઃఆͯ͠ʜ ˢ ͬͪ͜͸$PEFYͷXQ@MJTU@DBUFHPSJFTͷ ϖʔδΛݟͳ͍ͱ෼͔Βͳ͍ 62
  63. 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. Ͱ͖ͨʂ ΧςΰϦʔͷ ౤ߘ਺ॱ  ߱ॱ 64

  65. ͜ͷΑ͏ʹɺϑΟϧλʔϑοΫ͸ ϑΟϧλʔ͞ΕΔ஋͕ͲΜͳ஋Ͱ ϑΟϧλʔϑοΫͰฦͨ͠஋͕ ͦͷޙͲͷΑ͏ʹ࢖ΘΕΔͷ͔͸ɺ ϑοΫʹΑͬͯҟͳΔ͠ɺ ιʔεΛݟͳ͍ͱ෼͔Βͳ͍ɻ 65

  66. ͞ΒʹɺΞΫγϣϯϑοΫ͸ 8PSE1SFTT͕ͲΜͳॱ൪Ͱ ԿΛॲཧ͍ͯ͠Δͷ͔ɺ ͋Δఔ౓Θ͔ͬͯͳ͍ͱ Ͳ͜ʹϑοΫ͍͍ͯ͠ͷ͔ ෼͔Βͳ͍ɻ 66

  67. ͑ʁ݁ہ ೉͍͠͡Όͳ͍͔ͬͯʜʁ ? 67

  68. ԶͷϑοΫ ͕ͦΜͳʹ ؆୯ͳΘ͚͕ͳ͍ʂ ԶͷϑοΫ ͕ͦΜͳʹ ؆୯ͳΘ͚͕ͳ͍ʂ 68

  69. ϑΟϧλʔϑοΫͷσόοάʹ͸ %FCVH#BS&YUFOEFSϓϥάΠϯͷ 7BSJBCMF-PPLVQػೳ͕ศར IUUQXPSEQSFTTPSHFYUFOEQMVHJOTEFCVHCBSFYUFOEFS Ͱ΋ ΞΫγϣϯϑοΫͱϑΟϧλʔϑοΫͷ ҧ͍ɺجຊతͳߟ͑ํΛ஌͓͚ͬͯ͹ ͦΜͳʹා͘ͳ͍Αʂ 69

  70. Ͱ͸࠷ޙʹ࿅श໰୊ɻ 70

  71. XQMPHJOQIQΛΧελϚΠζͯ͠ΈΑ͏ XQMPHJOQIQ͸ϩάΠϯը໘ ݟͨ໨ΛΧελϚΠζͰ͖Δ֤छͷ ΞΫγϣϯˍϑΟϧλʔϑοΫ͕͋Δ ͙͢ʹ֬ೝͰ͖Δ͠Өڹൣғ΋গͳ͍ͷ Ͱ࿅श޲͖ 71

  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ʢൈਮʣ 72
  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ʹ͸ 8PSE1SFTTެࣜαΠτͷ63-͕ ֨ೲ͞Ε͍ͯΔ ʢ຋༁ϑΝΠϧʹΑ࣮ͬͯࡍʹ͸ KBXPSEQSFTTPSHʹͳΔʣ 73
  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ʹ ϑΟϧλʔ͕ద༻͞Ε͍ͯΔ 74
  75. 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
  76. GVODUJPOTQIQ͔ΒϦϯΫઌΛม͑ͯΈΑ͏ function change_login_headerurl( $login_headerurl ) { ! return 'http://2013.wordfes.org/'; }

    add_filter( 'login_headerurl', 'change_login_headerurl' ); 76
  77. XQMPHJOQIQͷΞΫγϣϯϑοΫ <?php do_action('login_footer'); ?> wp-login.phpʢൈਮʣ ΞΫγϣϯϑοΫ͕࣮ߦ͞ΕΔͷ͸ EP@BDUJPOؔ਺ ॲཧͷʮ௥ՃʯͳͷͰɺ طଘͷ஋Λ࢖͏͜ͱ΋ͳ͘ γϯϓϧͰ͢Ͷɻ

    77
  78. XQMPHJOQIQͷΞΫγϣϯϑοΫ function login_footer_message() { ! echo '<h1 style="text- align:center">ͭͳ͕Ζ·͍ʂ</h1>'; }

    add_action( 'login_footer', 'login_footer_message' ); ϝοηʔδΛ௥Ճͯ͠Έͨ 78
  79. ࿅श໰୊ɿϩάΠϯΤϥʔϝοηʔδ echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n"; wp-login.phpʢൈਮʣ

    ΤϥʔϝοηʔδͷʮɻʯΛ ʮὑʯʹม͑ͯΈ·͠ΐ͏ʂ ղ౴͸ͪ͜Β IUUQTHJTUHJUIVCDPNIJTTZ DGCB 79
  80. ϑοΫ͕ා͘ͳ͘ͳ͔ͬͨͳʁʁ 80

  81. ϑοΫʹؔ͢ΔϒϩάΛ৭ʑΞοϓͯ͠·͢ɻ ϑΟϧλʔϑοΫɿΧελϜϝχϡʔͷ߲໨ʹ෇༩͞ΕΔΫϥεΛΧελϚΠζ͢Δ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ϑΟϧλʔϑοΫɿݕࡧ݁ՌͰ౤ߘλΠϓ͝ͱʹҧ͏ςϯϓϨʔτϑΝΠϧΛ࢖͏ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ΞΫγϣϯϑοΫɿςʔϚ͔Β+BWBTDSJQU΍$44ΛಡΈࠐΉॻ͖ํ·ͱΊ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ΞΫγϣϯϑοΫɿπʔϧόʔΛΧελϚΠζ͢Δ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ΞΫγϣϯϑοΫɿύϯͣ͘φϏήʔγϣϯʢ#SFBEDSVNC/BW95ʣΛΧελϚΠζ͢Δ

    IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT ϑΟϧλʔϑοΫɿΪϟϥϦʔΛΧελϚΠζͯ͠޷͖ͳK2VFSZϓϥάΠϯΛ࢖͏ IUUQOPUOJMDSFBUJWFDPNCMPHBSDIJWFT 81
  82. 5IBOLT 82