My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 1050: Statically calling class methods
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----

Sign in to add a comment
Reported by, Aug 26, 2010
SVN revision or version used (not 'latest')?:

Version of WordPress used?:

Please provide any additional information below:
Whilst debugging various plugins I set PHP error reporting to E_ALL. This was very informative!

There are numerous errors of the form:
non-static method K2Header::output_header_css() should not be called statically in ..\wp-includes\plugin.php on line 395

This approach to programming seems to be deprecated now and no longer good practice. They need to be replaced with calls of the form, for example:
$myK2Header= new K2Header();

etc so they can be called non-statically.

I believe there are only 6 files that need changing - to find I did a Directory Search for '::' - the giveaway for static calls!
e.g. in app/classes/header.php the static calls appear in lines 76,167,180,205 and 219.

It seems replacing these with non-static calls to methods is better practice, will cause less errors and therefore will be more efficient.

Please consider changing them. Many thanks for a great theme. Here's hoping it can become even better!

Thanks for listening,

Sign in to add a comment

Powered by Google Project Hosting