Articles of deprecation

Can I check plugins and themes for PHP 5.6 ahead of global PHP server Update

My server is updating to PHP 5.6 next week. I manage about 30 WordPress websites. I looked for a plugin that would check if any of the code throughout the other plugins and theme would break with the update. I tried using the log deprecated notices plugin but it didn’t seem very conclusive as to […]

How to debug WordPress correctly?

I’m using a few plugins and UpThemes framework on my new website and if I turn on Wp Debug I can see that there are a few errors related to Deprecated functions (but website is working). What I would like to know is if there is a plugin, a software or a pray (lol) that […]

_deprecated_argument for constants

i’m working on updating a theme and previously it had used a lot of php CONSTANTS to set up some options as true or false. we’re going to be updating these “decisions” to use add_theme_support() instead. is it appropriate to use the _deprecated_argument() function to tell child themers that these constants are deprecated? if not, […]

Use 'add_theme_support' instead of 'add_custom_image_header' In WordPress 3.4

I am debugging my theme using Debug Bar plugin, which is showing me this error (among a few others): Notice: add_custom_image_header is deprecated since version 3.4! Use add_theme_support( ‘custom-header’, $args ) instead. Okay, clearly, it says I need to use this instead of this. The question is, add_custom_image_header has three parameters, namely: $header_callback $admin_header_callback $admin_image_div_callback […]

Warning/Notice about functions.php

I have trouble about the notice shows on the top of the home page as: Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7 with no alternative available. in …/wordpress/wp-includes/functions.php on line 2925 The code of this line is something about $wpsmiliestrans: ‘;)’ => ‘icon_wink.gif’, If I delete this code, it […]

How to replace bloginfo(template_url)

Basically I’ve used bloginfo(template_url) in a WordPress theme, but when I run theme-checker, it recommends to replace bloginfo(template_url) with get_template_directory_uri(), however when I use get_template_directory_uri() it doesn’t work. It works fine if I use it to replace get_bloginfo(template_url) but that’s not what I want now. Is bloginfo(template_url) being deprecated? If it is, what is it’s […]

Automating deprecated call checks?

I’ve recently started revamping and re-releasing some abandoned (yet important) WordPress plugins. As I walk through the code patching other bugs, my IDE highlights deprecated function calls for me, which is fantastic! I fix them immediately when I find them and move on. Anything I don’t catch is called out by a Log Deprecated Calls […]

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 […]

Deprecating functions in a plugin class

I’m updating one of my plugins and I’m a little stuck with deprecating functions. Originally, my plugin had a global variable and the plugin’s main class was instantiated and stored in the global variable. This way users could use the global to access functions in the plugin class. $GLOBALS[‘my_custom_plugin’] = new my_custom_plugin(); Then, for example, […]

How to deprecate a function used in a plugin?

One of the functions I’m using in my plugin is polluting the global scope with a name that could collide with another function (used in another plugin). So, I guess I should deprecate it. But how should I go about that? function foo() { echo ‘bar’; } I’m aware of _deprecate_function() but would be grateful […]