Jump to content

global keyword in php


colap
 Share

Recommended Posts

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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.