[wp-hackers] New add_meta_box function

Stephen Rider wp-hackers at striderweb.com
Tue Feb 19 18:27:10 GMT 2008


Maybe just check for version #?

A bit kludgy, I know, but you do know exactly when the change was  
made....

Actually, this is a really good question in general terms, as making  
this distinction is probably going to help a number of plugins  
seeking backwards-compatibility.

Stephen

On Feb 19, 2008, at 12:02 PM, Jennifer Hodgdon wrote:

> So, I'm trying to use the new add_meta_box function in a plugin.  
> The issue I have is that I want to have a plugin that works for old  
> and new WP versions. So I put in this logic:
>
> if( function_exists( 'add_meta_box' )) {
>   add_meta_box( something );
>  } else {
>   add_action('dbx_post_advanced', something );
>  }
>
> The problem is that add_meta_box is not defined yet when the plugin  
> is loaded.


More information about the wp-hackers mailing list