throwaway111
Forum Replies Created
-
I also submitted a copy of this info to WP Engine in case it’s something their engineers need to look into.
Thanks, I understand what these are. I’ve been a PHP developer for 20+ years.
For context, I’ve been trying to figure out why Kadence Blocks is causing a plugin I wrote to register several custom post types to throw a “Function _load_textdomain_just_in_time was called incorrectly” message. The noise of other messages appearing in logs and elsewhere makes this harder to do.
FWIW, I traced the issue to class-kadence-blocks-prebuilt-library.php, which gets an instance of the object as soon as the file loads — before textdomains are loaded — instead of using a hook such as init. It resolved when I tried wrapping it in a hook:
function test_this_hook() {
Kadence_Blocks_Prebuilt_Library::get_instance();
}
add_action( 'init', 'test_this_hook', 2 );The cron_schedules filter hook in this class appears to be where Kadence is bumping into my plugin, as the message fires when my own plugin adds custom cron schedules with translatable strings using the same hook.
Forum: Fixing WordPress
In reply to: WordPress 6.8. Update IssuesThanks, I wasn’t requesting help here. I was affirming Mario’s experience as something that maybe should not be dismissed out of hand. I am also running ACF (Pro) and Wordfence. If Mario has recent versions installed, I don’t think he should be encountering textdomain errors.
I noticed this morning that a ticket related to this issue was submitted on Trac maybe three weeks ago, and it was similarly categorized as a plugin issue and closed.
Forum: Fixing WordPress
In reply to: WordPress 6.8. Update IssuesI, too, am getting scads of the “Function _load_textdomain_just_in_time was called incorrectly.” messages. This is on my dev site and I intentionally have error reporting turned on to check for issues.
The thing is, I know a bunch of these are using the init hook or later because I went through all the plugins and reported this issue to developers after the notice was first introduced in WP 6.7. One of the plugins triggering this message is one I wrote myself, and it uses the init hook. It’s a textbook implementation of plugin_load_textdomain(). There does seem to be a deeper issue that appeared with the WP 6.8 update.
Hi! Yes, so right now you have the following line of code:
echo '<div id="bafg_copy">' . esc_html__( 'Shortcode Copied!', 'bafg' ) . '</div>';With a corresponding style in bafg-admin-style.css to hide it. The message is displayed using an onclick function in bafg-script.js.
Actually, as I look at the function in the JS file, I think it already does what you need it to do with:
function copyAlert() {
if (time == 200) {
clearInterval(id);
elem.style.display = 'none';
} else {
time++;
elem.style.display = 'block';
}
}In which case, the only changes you may need to make are:
echo '<div id="bafg_copy" style="display:none;">' . esc_html__( 'Shortcode Copied!', 'bafg' ) . '</div>';and then remove the display: none from the style rules for #bafg_copy in the CSS file because it is redundant.
I hope that helps!
Thank you!
Another strategy to consider is adding a style with display: none to the div output and adjusting the JS displaying it to change that attribute to display: block or inline-block when activated. I haven’t dug into the JS to see if it’s feasible in this instance, but I’ve used this approach successfully on projects of my own.
Your update resolved the issue. Thanks!
Forum: Plugins
In reply to: [WP-Paginate] Load textdomain PHP noticeIt did. Thank you!