colap Posted October 31, 2011 Share Posted October 31, 2011 It's a function=> function _wp_call_all_hook($args) { global $wp_filter; //var_dump($wp_filter); //exit(); reset( $wp_filter['all'] ); do { foreach( (array) current($wp_filter['all']) as $the_ ) if ( !is_null($the_['function']) ) call_user_func_array($the_['function'], $args); } while ( next($wp_filter['all']) !== false ); } Why is $wp_filter variable declared as global ? Was $wp_filter assigned before ? Quote Link to comment https://forums.phpfreaks.com/topic/250193-global-keyword-in-php/ Share on other sites More sharing options...
MasterACE14 Posted October 31, 2011 Share Posted October 31, 2011 I'm assuming this is a word press function? with which I'm not familiar. However globals should be avoided, it should be passed as argument to the function. Quote Link to comment https://forums.phpfreaks.com/topic/250193-global-keyword-in-php/#findComment-1283817 Share on other sites More sharing options...
KevinM1 Posted October 31, 2011 Share Posted October 31, 2011 WordPress is a piece of crap under the hood. Well written PHP never has the 'global' keyword in it. Quote Link to comment https://forums.phpfreaks.com/topic/250193-global-keyword-in-php/#findComment-1283836 Share on other sites More sharing options...
trq Posted November 1, 2011 Share Posted November 1, 2011 WordPress is a piece of crap under the hood. Well written PHP never has the 'global' keyword in it. Agreed. It's a very poorly designed application/framework. It's just a shame it works so well and is so easy to customize. Quote Link to comment https://forums.phpfreaks.com/topic/250193-global-keyword-in-php/#findComment-1283910 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.