Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Search WordPress.org
Readytogetstarted?
DownloadWordPress
Codex
PluginAPI/ActionReference/wpfooter
Languages:English(Addyourlanguage)
Codextools:Login
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
codex.wordpress.org/Plugin_API/Action_Reference/wp_footer
2/2