It really depends on your implementation. and your example seems wrong. You need on add_action( 'wp_head', 'some_function' ); Inside that function is your code.
Marko Op 18 dec. 2012, om 19:14 heeft "Philip M. Hofer \(Frumph\)" <[email protected]> het volgende geschreven: > Is there a way to fire add_action on a function that happens multiple times ? > > usage, for example is adding a meta tag to wp_head each and every post that > is displayed > > > -----Original Message----- From: Marko Heijnen > Sent: Tuesday, December 18, 2012 10:07 AM > To: [email protected] > Subject: Re: [wp-testers] add_action anonymous function > > The use of an anonymous function is bad code practice and I removed that part > of the codex. Another reason it required PHP 5.3 > > The reason it fails it probably due an old PHP version. > > Marko > > > Op 18 dec. 2012, om 18:59 heeft Léonard Wüst <[email protected]> het > volgende geschreven: > >> bitte meine adresse löschen danke >> >> 2012/12/18 Philip M. Hofer (Frumph) <[email protected]> >> >>> Taken from the add_action codex http://codex.wordpress.org/** >>> Function_Reference/add_action#**Simple_Hook<http://codex.wordpress.org/Function_Reference/add_action#Simple_Hook> >>> >>> add_action('wp_head', function() { echo 'something';}) >>> >>> is supposed to work, it just makes my site die >>> >>> >>> ______________________________**_________________ >>> wp-testers mailing list >>> [email protected].**com <[email protected]> >>> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >>> >> >> >> >> -- >> mit freundlichen grüssen aus sursee >> léonard wüst, oberstadt 10, 6210 sursee >> onlinedienstleistungen, mediaservice >> preisgünstige professionelle homepages, journalismus >> >> www.leonardwuest.ch >> www.innerschweizonline.ch >> www.bochumer-zeitung.net >> _______________________________________________ >> wp-testers mailing list >> [email protected] >> http://lists.automattic.com/mailman/listinfo/wp-testers > > _______________________________________________ > wp-testers mailing list > [email protected] > http://lists.automattic.com/mailman/listinfo/wp-testers > _______________________________________________ > wp-testers mailing list > [email protected] > http://lists.automattic.com/mailman/listinfo/wp-testers _______________________________________________ wp-testers mailing list [email protected] http://lists.automattic.com/mailman/listinfo/wp-testers
