Plug-in yog software software uas, thaum txuas nrog rau cov haujlwm tseem ceeb, pabcuam kom nthuav lossis siv cov peev xwm uas twb muaj lawm. Rau lub vev xaib WordPress, koj tuaj yeem rub tawm cov qauv tsim nyog hauv Is Taws Nem, lossis koj tuaj yeem tsim koj tus kheej.
Nws yog qhov tsim nyog
- - khoos phis tawj;
- - Is taws nem sib txuas;
- - cov ntawv nyeem sau ntawv uas muaj peev xwm khaws cov ntawv sau rau hauv UTF-8 encoding.
Cov Lus Qhia
Kauj ruam 1
Saib seb lub zog ua haujlwm ua qhov plugin yuav tsum ua. Koj kuj yuav tsum tau xaiv lub npe tshwj xeeb rau nws. Koj tuaj yeem tshawb xyuas cov npe WordPress plugin siv cov lus tshawb nrhiav Google. Feem ntau lub npe ntawm lub plugin tau ncaj qha ntsig txog nws lub hom phiaj.
Kauj ruam 2
Tom qab ntawd tsim lub ntsiab PHP plugin cov ntaub ntawv. Nws yog qhov tsim nyog hais tias nws lub npe tshwj xeeb nrog lub npe ntawm tus qauv ntxiv-kuj thiab nws kuj yog qhov tshwj xeeb. Plugin code tuaj yeem muab faib ua ntau yam ntawm PHP cov ntaub ntawv. Nws kuj tseem tuaj yeem suav nrog JavaScript, CSS files, dluab, thiab lwm yam. Thaum muab faib tawm koj txoj cai plugin, koj yuav tsum tsim cov ntawv qhia npe nrog tib lub npe ntawm PHP lub ntsiab, thiab tom qab ntawd muab tag nrho cov ntaub ntawv nyob ntawd.
Kauj ruam 3
Qhib cov ntaub ntawv tseem ceeb tshaj plaws module tsim thiab tsim cov qauv taub kom cov WordPress platform tuaj yeem paub txog lub plugin tshiab. Piv txwv li: Yog tias koj mus rau ntawm pawg thawj coj saib xyuas thiab nyem rau ntawm "Plugins" yam khoom, koj yuav pom cov plugin uas tsim nyob hauv daim ntawv teev npe.
Kauj ruam 4
Tom qab cov npe, sau rau plugin cov ntaub ntawv tso cai cov ntaub ntawv. Feem ntau GRL lossis daim ntawv tso cai sib xws tau siv.
Kauj ruam 5
Lub kaw lus ntawm hooks yog siv los sib cuam tshuam ntawm cov khoom sib txuas ntawm lub plugin thiab cov tub ntxhais WordPress. Nws lub ntsiab lus nyob hauv qhov tseeb hais tias lub zog ntawm cov haujlwm, ua ntej rov qab qhov tshwm sim, hu xov tooj rau cov saw ntawm ntxiv tus tuav, yog tias lawv tau sau npe tam sim no. Yog li, ua ntej ntxiv lub ncauj lus rau ib qho kev tshaj tawm, WordPress xyuas rau cov neeg tuav haujlwm rau tus nqe tauj lub npe hu ua_title. Ntxiv qhov tsim nyog hooks rau lub plugin thiab sau npe rau lawv los ntawm kev hu rau add_filter.
Kauj Ruam 6
Txhawm rau ua haujlwm ntxiv siv cov plugins, koj yuav tsum tsim cov ntawv cim npe. Txhawm rau tshaj tawm template, sau qhov ua haujlwm PHP thiab sau nws rau cov neeg siv cov plugin.
Kauj Ruam 7
Tom qab sau cov plugin, nws raug nquahu kom npaj nws rau kev ua haujlwm thoob ntiaj teb, i.e. siv lub peev xwm los txhais cov lus piav qhia ua ntau hom lus. Ua li no, xaiv ib lub npe rau lub plugin txhais lus chaw. Nws yuav tsum yog yam ntxwv ntawm lub npe ntawm lub plugin nws tus kheej. Qhwv tag nrho cov kab ntawv ntawm cov ntawv nyeem uas yuav ua rau tus nyeem ntawv nyob hauv ib qho ntawm ob txoj haujlwm WordPress gettext: _ () lossis _e (). Tsim ib lub POT (txhais lus cov ntawv sau npe) cov ntaub ntawv thiab muab faib nrog rau lub plugin. Txhawm rau thauj cov txhais lus, siv load_plugin_textdomain muaj nuj nqi.
Kauj ruam 8
Tsim lub vev xaib piav qhia txog kev teeb tsa koj lub plugin, cov haujlwm nws yuav ua li cas, thiab cov khoos kas twg ntawm WordPress nws tau sib xws nrog.