Slide 1

Slide 1 text

“ਖ਼͍͠” ςʔϚͷ࡞Γํ Shinichi Nishikawa WordCamp Kansai 2016 ͜Ε͕Ͱ͖ͨΒςʔϚ੍࡞ͷ্ڃऀ

Slide 2

Slide 2 text

“ਖ਼͍͠”ʁ

Slide 3

Slide 3 text

ελϯμʔυ͕͋Γɺ ཧ༝͕͋Γɺ ϝϦοτ΋͋Δɻ

Slide 4

Slide 4 text

ࠓ೔ͷ࿩ ۩ମతʹɺίʔυΛݟͳ͕ΒɺϕετϓϥΫ ςΟεΛֶͼɺࠓޙࣗ෼ͰεΩϧΛ޲্ͯ͠ ͍͚ΔΑ͏ʹɺϦιʔε΍ͦͷௐ΂ํΛֶͿɻ

Slide 5

Slide 5 text

Shinichi Nishikawa @shinichiN

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

͜ͷ3݄·Ͱ

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

3݄͔Β

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

http://ogi.osampo-radio.com/

Slide 14

Slide 14 text

ϒϩά http://nskw-style.com

Slide 15

Slide 15 text

ӳޠ൛ http://th-daily.shinichi.me

Slide 16

Slide 16 text

ձࣾ http://nobil.cc

Slide 17

Slide 17 text

Ҡॅϒϩά & Podcast http://thai.osampo-radio.com http://journey.osampo-radio.com

Slide 18

Slide 18 text

WordPress ͱͷؔ܎

Slide 19

Slide 19 text

WordCamp Tokyo 2012 ࣮ߦҕһ௕

Slide 20

Slide 20 text

Bangkok WordPress Meetup ্ཱͪ͛ɻӳޠʗλΠޠάϧʔϓɺ೔ຊޠάϧʔϓ

Slide 21

Slide 21 text

WordBench உ໦ౡ

Slide 22

Slide 22 text

WordCamps

Slide 23

Slide 23 text

ຊ೔ͷΰʔϧ

Slide 24

Slide 24 text

۩ମతʹɺίʔυΛݟͳ͕ΒɺϕετϓϥΫςΟε Λֶͼɺࠓޙࣗ෼ͰεΩϧΛ޲্͍͚ͯ͠ΔΑ͏ʹɺ Ϧιʔε΍ͦͷௐ΂ํΛֶͿɻ

Slide 25

Slide 25 text

ࡢ೥ͷςʔϚ͸ɺ ʮςʔϚ੍࡞ͷϕετϓϥΫςΟεʯ Ͱɺͦͷ݁࿦͸ɺ

Slide 26

Slide 26 text

1. ݟͨ໨ʹప͢Δ 2. ͲΜͳϓϥάΠϯͱ΋ػೳ͢ΔͨΊͷ࡞๏Λ஌Δ 3. WordPress ͷػೳΛϑϧ׆༻ 4. ίϯςϯπʹ৮Βͳ͍ Ͱͨ͠ɻ 4ͭͷϕετϓϥΫςΟε http://www.slideshare.net/NSKW/ learning-from-theme-review-requirements

Slide 27

Slide 27 text

ͦͷଓ͖తͳҐஔ͚ͮͰ͢

Slide 28

Slide 28 text

େ -> খ ͷॱ൪Ͱ͍͖·͢Ͷ

Slide 29

Slide 29 text

WordPress ࣗମ͕ ਐԽ͍ͯ͘͠ͷΛ஌Δ

Slide 30

Slide 30 text

wp_title() Λ΍ΊΔ͜ͱʹͳͬͨ

Slide 31

Slide 31 text

ςʔϒϧɺ1ݸ૿͑ͨ

Slide 32

Slide 32 text

wordpress.org/news ָ͕

Slide 33

Slide 33 text

ςʔϚͷछྨ

Slide 34

Slide 34 text

ςʔϚͷछྨ • ਌ςʔϚ • ࢠςʔϚ • ελʔλʔςʔϚ • _s • ϑϨʔϜϫʔΫతͳ΋ͷ • roots.io/sage ख़஌ͯ͠ɺ ໨తʹԠͯ͡ɺ ࢖͍෼͚͕Ͱ͖ΔΑ͏ʹ

Slide 35

Slide 35 text

ͨͱ͑͹ɺɺ ʮ ϚϧναΠτͰࢧళϖʔδΛͨ͘͞Μ࡞Δʯͱ͍͏৔߹ɺ - ϕʔεʹͳΔςϯϓϨʔτ਌ςʔϚΛͰ࡞੒ - indexͷϖʔδΛࢠςʔϚɺࢧళͷϖʔδΛผͷࢠςʔϚ - ͋Δ͍͸਌αΠτ͸ಠཱͷςʔϚɺࢧళͷ਌ςʔϚΛઃஔ͠ɺ֤ࢧళ͸ඞཁʹ Ԡͯ͡ࢠςʔϚΛ࡞੒ͯࠩ͠෼ͷΈ࡞Δ - ػೳ͸શ෦ϓϥάΠϯʹམͱ͜͠ΜͰɺબ୒తʹ༗ޮԽ

Slide 36

Slide 36 text

ςϯϓϨʔτ֊૚ ͱ get_template_parts()

Slide 37

Slide 37 text

ख़஌͠Α͏ʂ

Slide 38

Slide 38 text

get_template_parts() ศར

Slide 39

Slide 39 text

ͨͱ͑͹ɺ

Slide 40

Slide 40 text

URL ؔ࿈

Slide 41

Slide 41 text

ςʔϚ΁ͷURI IUUQFYBNQMFDPNXQDPOUFOUUIFNFTNZUIFNFJNHBQOH ͱ͔ XQDPOUFOUUIFNFTNZUIFNFJNHBQOH ͱ͔ॻ͔ͳ͍ɻ ҧ͏؀ڥ΍44-Խͨ࣌͠ͱ͔ࠔΔɻ

Slide 42

Slide 42 text

αΠτͷURL ͱ͔BCPVUͱ͔͠ͳ͍ɻ QIQCMPHJOGP lVSMz ͱ͔͠ͳ͍ɻ

Slide 43

Slide 43 text

Slide 44

Slide 44 text

underscores ͷ head ෦෼

Slide 45

Slide 45 text

ۃ୺ʹݴ͑͹ɺ͜ΕͰ΋͍͚Δ ಈతʹ͢Δ͜ͱͰɺ ͍͍͜ͱ͕͋Δɻ

Slide 46

Slide 46 text

͍͍͜ͱ • ͲΜͳ؀ڥͰ΋ಈ͘ • ϓϥάΠϯͱڞଘͰ͖ΔʗίϯϑϦΫτͳ͠ • ϓϥάΠϯ΍ࢠςʔϚ͔Βग़ྗΛม͑ΒΕΔ • ʢͳΜ͔ؾ΋͕͍͍ͪؾ͕͢Δʣ

Slide 47

Slide 47 text

Slide 48

Slide 48 text

wp_head() / wp_footer() ͦΕͧΕ ͷ௚લɺ

Slide 49

Slide 49 text

wp_head() / wp_footer() IFBE಺ʹԿ͔Λ௚઀ग़ྗ͍ͤͨ࣌͞ͳͲʹɻ

Slide 50

Slide 50 text

wp_head() / wp_footer() ιʔεΛݟΔͱɺͨͩͷEP@BDUJPOͰ͢ɻ

Slide 51

Slide 51 text

wp_enqueue_script / wp_enqueue_style ͷ஥ؒ Javascript, stylesheet ΛಡΈࠐΉͱ͖ʹ࢖͏ɻ ςʔϚͱϓϥάΠϯͷ྆ํ͔Β jQuery ͕ݺ͹Ε ͨ࣌ɺґଘ͢ΔεΫϦϓτ͕͋ΔࡍͳͲʹศརɻ

Slide 52

Slide 52 text

wp_enqueue_script / wp_enqueue_style

Slide 53

Slide 53 text

wp_register_script / wp_enqueue_script

Slide 54

Slide 54 text

wp_dequeue_script / wp_dequeue_script ࢠςʔϚ΍ϓϥάΠϯ͔Βɺ ͢Ͱʹొ࿥͞Ε͍ͯΔ +BWBTDSJQU΍TUZMFTIFFUΛ আ੶͢Δ࣌ʹ࢖͏ɻ

Slide 55

Slide 55 text

wp_add_inline_script / wp_add_inline_style

Slide 56

Slide 56 text

ίΞʹಉࠝ͞Ε͍ͯΔεΫϦϓτ K2VFSZ΍ͦͷ஥ؒɺ6OEFSTDPSFKT #BDLCPOFKTͳͲ͸ 8PSE1SFTTʹ͸͡Ί͔Βೖ͍ͬͯͯɺϋϯυϧ໊ͷΈͷ ࢦఆFORVFVFͰಡΈࠐ·ΕΔɻ ͜ΕͰɺ XQJODMVEFTKTKRVFSZKRVFSZKT XQJODMVEFTKTKRVFSZKRVFSZNJHSBUFNJOKT XQJODMVEFTKTKRVFSZVJF⒎FDUNJOKT XQJODMVEFTKTKRVFSZVJF⒎FDUCMJOENJOKT ͷ͕ͭಡΈࠐ·ΕΔɻ IUUQTEFWFMPQFSXPSEQSFTTPSHSFGFSFODFGVODUJPOTXQ@FORVFVF@TDSJQU

Slide 57

Slide 57 text

ηΩϡϦςΟ

Slide 58

Slide 58 text

ςʔϚͰؾΛ͚ͭΔ͜ͱ • ςʔϚ͸ݟͨ໨ͷ͜ͱͳͷͰɺग़ྗɻʢͭ· ΓɺԿ͔Λอଘ͠ͳ͍ʣ • ͳͷͰɺόϦσʔγϣϯͱΤεέʔϓ͕ओɻ

Slide 59

Slide 59 text

όϦσʔγϣϯ • ஋ͷݕࠪͷ͜ͱ • ૝ఆͯͨ͠ͷͱҧ͏ͷ͕དྷͯɺڍಈ͕͓͔͘͠ͳ ΔͷΛ๷͙ • ਺ࣈͳΒ਺ࣈɺจࣈྻͳΒจࣈྻɺϝΞυͳΒϝ ΞυͰ͋Δ͜ͱΛ֬ೝ͢Δɻ • ͦΕ༻ͷؔ਺ɺϗϫΠτϦετɺϒϥοΫϦετ ͳͲͷํ๏͕͋ΔͷͰݟͯΈ·͠ΐ͏

Slide 60

Slide 60 text

ϗϫΠτϦετʗϒϥοΫϦετ • ϗϫΠτϦετ • OKͳ஋܈ΛϦετ͓͍ͯͯ͠ɺೖྗ஋ʢࠓ͔Β ݕࠪ͠Α͏ͱ͍ͯ͠Δର৅ʣ͕ɺ͜ͷϦετʹೖͬ ͍ͯΔ͔Ͳ͏͔Λ֬ೝ͢Δํ๏ • ϒϥοΫϦετ • NGͳ஋܈ΛϦετ͓͍ͯͯ͠ɺೖྗ஋͕͜Εʹ ͋ͨΔ͔Ͳ͏͔Λ֬ೝ͢Δํ๏

Slide 61

Slide 61 text

ϗϫΠτϦετ

Slide 62

Slide 62 text

Τεέʔϓ • esc_* ؔ਺Λ཈͑Δ • wp_kses() Λ֮͑Δ

Slide 63

Slide 63 text

esc_*()

Slide 64

Slide 64 text

wp_kses() • ͋Β͔͡Ίఆٛ͞Εͨ html λάͱଐੑͷΈΛ ڐՄ͠ɺͦΕҎ֎͸ফͯ͠ɺ҆શͳ html จࣈ ྻΛฦ͢ɻ • ϑΟϧλϦϯάͰ͖Δɻ • a λάΛؚΊ͍͚ͨͲΤεέʔϓ͍ͨ࣌͠ͳͲ ʹศར

Slide 65

Slide 65 text

ԿΛΤεέʔϓ͢Δͷ͔ • ʮ֎͔Βདྷͨɺ৴པͰ͖ͳ͍஋͸શ෦ʯ
 
 ͨͱ͑͹ɺɺɺ • GET ΍ POST ͳͲͰૹ৴͞Ε͖ͯͨ஋ • σʔλϕʔε͔ΒऔΓग़ͨ͠஋ • RSSϑΟʔυ΍APIܦ༝ͳͲ֎෦αʔϏε͔ΒऔΓग़͠ ͨ஋

Slide 66

Slide 66 text

Ͳ͏Τεέʔϓ͢Δͷ͔ • ͳͥɺecho ͷதͰΤεέʔϓ͠ͳ͍ͷ͔ͱ͍ ͏ͱɺग़ྗ͞ΕΔจ຺ʹΑͬͯɺΤεέʔϓͷ ํ๏͕ҟͳͬͯ͘Δ͔Βɻ • ͳͷͰɺจ຺ʹΑͬͯطଘͷؔ਺Λ࢖͍෼͚ Δ͜ͱ͕େࣄɻ

Slide 67

Slide 67 text

ςϯϓϨʔτλά ͱ WordPress ͷؔ਺ ͷҧ͍

Slide 68

Slide 68 text

ͨͱ͑͹ɺ • the_content(); ͱ echo get_the_content();
 ͸ಉ͡Ͱ͸ͳ͍ɻ • echo get_permalink(); ͱ the_permalink();
 ͸ಉ͡Ͱ͸ͳ͍

Slide 69

Slide 69 text

the_content() ͱ͸

Slide 70

Slide 70 text

the_content ϑΟϧλʔͱ͸ XQJODMVEFTEFGBVMUpMUFSTQIQ

Slide 71

Slide 71 text

ςϯϓϨʔτλάͱͦͷଞͷؔ਺ • ςϯϓϨʔτλά͸ɺ͍Ζ͍ΖͱؾΛ࢖ͬͯ ͘Ε͍ͯΔͷͰɺ҆৺ͯ͠࢖͍͍ͬͯɻ
 the_ Ͱ͸͡·Δ΋ͷ • ͦ͏Ͱͳ͍΋ͷ͸ɺ஫ҙ͠ͳ͍ͱࢥΘ͵ڍಈ ʹͳΔ͔΋͠Εͳ͍ɻϑΟϧλʔΛ௨Βͳ͍ɻ ϓϥάΠϯ͔Βมߋ͕ޮ͍ͯͳ͔ͬͨΓͱ͔ ͢Δɻ

Slide 72

Slide 72 text

΢ΟδΣοτɺΧελϜ౤ߘλΠϓɺΧ ελϜλΫιϊϛɺWP_*_Query ͳͲ ͷొ࿥༻ͷίʔυ͸δΣωϨʔλΛ࢖͏ɻ

Slide 73

Slide 73 text

generatewp.com

Slide 74

Slide 74 text

ςʔϚ੍࡞ͷ্ڃऀͱ͸ʁ

Slide 75

Slide 75 text

1. ݟͨ໨ʹప͢Δ 2. ͲΜͳϓϥάΠϯͱ΋ػೳ͢ΔͨΊͷ࡞๏Λ஌Δ 3. WordPress ͷػೳΛϑϧ׆༻ 4. ίϯςϯπʹ৮Βͳ͍ Ͱͨ͠ɻ ڈ೥ͷ 4ͭͷϕετϓϥΫςΟε http://www.slideshare.net/NSKW/ learning-from-theme-review-requirements

Slide 76

Slide 76 text

্ڃऀ • ݟͨ໨ʹప͢Δɻcss, Javascript ؤுΔɻ • WordPress తͳॻ͖ํΛ஌Δɻ • ηΩϡϦςΟʹؾΛ࢖͏ɻ • δΣωϨʔλɺεχϖοτͳͲΛ׆༻͢Δɻ • ࢠςʔϚɺελʔλʔςʔϚɺϑϨʔϜϫʔΫͳͲΛ׆༻͢Δɻ • ػೳ͸ϓϥάΠϯʹৡΔɻ PHP ͷଆ໘͔ΒݟΔͱɺ ςʔϚ੍࡞ͱͯ͠஌Βͳ͍ͱ͍͚ͳ͍͜ͱ͸ɺ ࣮͸ͦΜͳʹͳ͍ɻ

Slide 77

Slide 77 text

͓͠·͍

Slide 78

Slide 78 text

Ϧιʔε • wordpress.org/news • developer.wordpress.org/themes/getting- started/ • developer.wordpress.org • ίσοΫε ͱ codex