[wp-testers] add_action anonymous function

2012-12-18 Thread Philip M. Hofer (Frumph)
Taken from the add_action codex 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 wp-testers@lists.a

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Léonard Wüst
bitte meine adresse löschen danke 2012/12/18 Philip M. Hofer (Frumph) > Taken from the add_action codex http://codex.wordpress.org/** > Function_Reference/add_action#**Simple_Hook > > add_action('wp_head', function() { echo 's

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Marko Heijnen
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 het volgende geschreven: > bitte meine adresse löschen da

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Philip M. Hofer (Frumph)
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: wp-testers@lists.automattic.co

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Marko Heijnen
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\)" het volgende geschreven: > Is there a way to fire add_action on

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Philip M. Hofer (Frumph)
.. what example? .. the one I wrote earlier that was in the codex ? (before you removed it) -Original Message- From: Marko Heijnen Sent: Tuesday, December 18, 2012 10:16 AM To: wp-testers@lists.automattic.com Subject: Re: [wp-testers] add_action anonymous function It really depends

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Marko Heijnen
The example to adding a meta tag to wp_head. It seems like you want to 'fire' the action inside your loop. That can't be done. You need to do all your add_action/add_filter inside functions.php and not in a theme file. Op 18 dec. 2012, om 19:19 heeft "Philip M. Hofer \(Frumph\)" het volgende

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Philip M. Hofer (Frumph)
.. just need to implement a way to add to the wp_head whenever a post is found, that's all ... I'll keep looking. eof. -Original Message- From: Marko Heijnen Sent: Tuesday, December 18, 2012 10:22 AM To: wp-testers@lists.automattic.com Subject: Re: [wp-testers] add_action anonymous f

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Léonard Wüst
ich verstehe nicht, wasSie meinen, um was handelt esw sich, von was reden Sie? 2012/12/18 Marko Heijnen > 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. >

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Chip Bennett
Maybe move this over to WP-Hackers, or WPSE? It's an interesting question, and I have some ideas, but probably has moved out-of-scope for WP-Testers. On Tue, Dec 18, 2012 at 1:28 PM, Philip M. Hofer (Frumph) wrote: > .. just need to implement a way to add to the wp_head whenever a post is > fou

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Marko Heijnen
Argh didn't even saw this was the testers list but the solution is to do add_action for 'wp_head' en then loop the main query. Marko Op 18 dec. 2012, om 19:29 heeft Chip Bennett het volgende geschreven: > Maybe move this over to WP-Hackers, or WPSE? It's an interesting question, > and I have

Re: [wp-testers] add_action anonymous function

2012-12-18 Thread Léonard Wüst
what have i to do with that? 2012/12/18 Marko Heijnen > Argh didn't even saw this was the testers list but the solution is to do > add_action for 'wp_head' en then loop the main query. > > Marko > > Op 18 dec. 2012, om 19:29 heeft Chip Bennett het > volgende geschreven: > > > Maybe move this ov