Skip to main content
2 of 2
"deprecated", not "depreciated"
Otto
  • 32.8k
  • 1
  • 66
  • 109

What is the best way to handle deprecated functions?

Wordpress 3.3 has deprecated the add_contextual_help() functions and it's filters, so in order to continue supporting 3.0 - 3.2.1 and also comply with 3.3, I have done the following:

global $wp_version;
if ($wp_version >= '3.3') {
    // New method
    add_action("load-$admin_page", 'CrayonSettingsWP::help_screen');
} else {
    // Depreciated method
    add_filter('contextual_help', 'CrayonSettingsWP::cont_help', 10, 3);
}

Is there a better approach?