It’s a wrong alert. Please contact the Codestyling Localization author about that.
Ahh… I see! Thanks for answering. Bucks coming soon! 🙂
Steve
Hi again.
I contacted the author of Codestyling Localization. He checked your code and says it’s not a false alert. See his response below.
Steve
This is not a false alert.
Here the code snippet from actual “Contact Form 7” code version 3.4.2:
function wpcf7_get_contact_form_default_pack( $args = '' ) {
global $l10n;
$defaults = array( 'locale' => null, 'title' => '' );
$args = wp_parse_args( $args, $defaults );
$locale = $args['locale'];
$title = $args['title'];
if ( $locale && $locale != get_locale() ) {
$mo_orig = $l10n['wpcf7'];
unset( $l10n['wpcf7'] );
if ( 'en_US' != $locale ) {
$mofile = wpcf7_plugin_path( 'languages/wpcf7-' . $locale . '.mo' );
if ( ! load_textdomain( 'wpcf7', $mofile ) ) {
$l10n['wpcf7'] = $mo_orig;
unset( $mo_orig );
}
}
}
As can be seen, it uses indeed:
load_textdomain( 'wpcf7', $mofile )
The load_textdomain is not used instead of load_plugin_textdomain. Also, use of load_textdomain can’t break behavior of WordPress. It merely makes Codestyling Localization impossible to interfere in other plugins process. As you may know from the code above, the load_textdomain is used for loading a translation for a specific language (not current locale), there is no need for Codestyling Localization to interfere in.
Just don’t shoot the messenger. 🙂
I guess why Codestyling Localization bothers with this code is because it is a translation plugin. But the thing is I’m no code guru (to say the least) so I’m just trying to find out what is going on.
I’ll let the author know your point above.
Thanks
Steve
Sorry, I didn’t intend to shoot you! And forgot to say thank you for taking the trouble of telling the plugin author about this 🙂
Actually I often see this Codestyling Localization message and got tired of explaining every time. Maybe the author assumes that every load_textdomain in other plugins is misuse of load_plugin_textdomain.