Sei sulla pagina 1di 2

02/01/14

Plugin API/Action Reference/wp footer WordPress Codex

Search WordPress.org

Readytogetstarted?

DownloadWordPress

Codex
PluginAPI/ActionReference/wpfooter
Languages:English(Addyourlanguage)

Codextools:Login

HomePage WordPressLessons GettingStarted Workingwith WordPress DesignandLayout AdvancedTopics Troubleshooting

Description
Thew p _ f o o t e r actionistriggerednearthe< / b o d y > tagoftheuser'stemplatebythew p _ f o o t e r ( ) function.Althoughthisis themedependent,itisoneofthemostessentialthemehooks,soitisfairlywidelysupported. Thishookprovidesnoparameters.Youusethishookbyhavingyourfunctionechooutputtothebrowser,orbyhavingitperform backgroundtasks.Yourfunctionsshouldn'treturn,andshouldn'ttakeanyparameters. ThishookisthemedependentwhichmeansthatitisuptotheauthorofeachWordPressthemetoincludeit.Itmaynotbeavailable onallthemes,soyoushouldtakethisintoaccountwhenusingit. Whenincluded,thedefaultoutputforthisfunctionistheadminpanelwhichwillbeshowninthetopofthetheme.Itshouldbekeptin thefooterforeverythemebecausemostofthepluginbindtheirscriptfilesorfunctionstothishook. Thishookisanactionwhichmeansthatitprimarilyactsasaneventtrigger,insteadofacontentfilter.Thisisasemanticdifference, butitwillhelpyoutorememberwhatthishookdoesifyouuseitlikethis:

DeveloperDocs AboutWordPress

CodexResources
Communityportal Currentevents Recentchanges Randompage Help

< ? p h p f u n c t i o n y o u r _ f u n c t i o n ( ) { e c h o ' < p > T h i s i s i n s e r t e d a t t h e b o t t o m < / p > ' } a d d _ a c t i o n ( ' w p _ f o o t e r ' , ' y o u r _ f u n c t i o n ' ) ? >

Setpriorityofyouraction
Ifyouwanttoinfluencethemomentthatyourhookisexecuted,youcanappendanintegeras3rdargumenttoadd_action:

< ? p h p f u n c t i o n y o u r _ f u n c t i o n ( ) { e c h o ' < p > T h i s i s i n s e r t e d a t t h e b o t t o m < / p > ' } a d d _ a c t i o n ( ' w p _ f o o t e r ' , ' y o u r _ f u n c t i o n ' , 1 0 0 ) ? >

Thehigherthenumber,thelowerthepriorityandasaresultyourhookwillbeexecutedfurtherdownthepage.Enqueuedscriptsare executedatprioritylevel20.

Thispageismarkedasincomplete.YoucanhelpCodexbyexpandingit.

Seealso
PluginAPI

codex.wordpress.org/Plugin_API/Action_Reference/wp_footer

1/2

02/01/14
PluginAPI/ActionReference Categories:Stubs|Actions

Plugin API/Action Reference/wp footer WordPress Codex

About Blog Hosting Jobs

Support GetInvolved Learn

Showcase Plugins Themes Ideas

WordCamp WordPress.TV BuddyPress bbPress

WordPress.com Matt Privacy License/GPLv2

Follow@WordPress Jaime 782k

codex.wordpress.org/Plugin_API/Action_Reference/wp_footer

2/2

Potrebbero piacerti anche