Forum Replies Created
-
AuthorPosts
-
Teia Local Studio
ParticipantTHANK you SO MUCH.
I am not in a hurry, but just want to have things working... Can't sleep well at night knowing about the bug. =) Ha ha!Teia Local Studio
ParticipantHej there!
Guys, I am having the same problem with METABOX 5.3.6.
I did register a WYSIWYG metabox and its behavior is completely erratic.The data I enter on the VISUAL tab is not visible no the CODE tab, and vice versa. Switching tabs does not update its contents. Also, sometimes it does not save when I publish the post. Sometimes it does. It's strange.
Reverting back to 5.3.5 solves the problem...
But it is not a solution — we need to stay up-to-date.Any ideas?
G.Teia Local Studio
ParticipantWell...
Found a workaround using LOCALIZE SCRIPT and injecting the content of my metabox as a VAR inside the JS.function my_admin_personal_scripts() { if (in_array('wordpress-seo/wp-seo.php', apply_filters('active_plugins', get_option('active_plugins')))) { global $post; $countable_content = get_post_meta($post->ID, 'my-super-duper-metabox-id', true); wp_register_script('yoast-counting-words', MY_JS_PATH.'/misc/injected-yoast-counter.js'); $content_found = array('metabox'=> $countable_content); wp_localize_script( 'yoast-counting-words', 'content_found', $content_found ); wp_enqueue_script( 'yoast-counting-words' ); } } add_action('admin_enqueue_scripts', 'my_admin_personal_scripts');And, inside the JS, I retrieve the content this way:
(...) addContent( data ) { data += content_found.metabox; //console.log(content_found.metabox); return data ; } (...)It could be useful to someone else!
G.Teia Local Studio
ParticipantHello again!
I found a tutorial on YOAST page that made the counter work for me:
/* global YoastSEO */ class MyCustomDataPlugin { constructor() { // Ensure YoastSEO.js is present and can access the necessary features. if ( typeof YoastSEO === "undefined" || typeof YoastSEO.analysis === "undefined" || typeof YoastSEO.analysis.worker === "undefined" ) { return; } YoastSEO.app.registerPlugin( "MyCustomDataPlugin", { status: "ready" } ); this.registerModifications(); } /** * Registers the addContent modification. * * @returns {void} */ registerModifications() { const callback = this.addContent.bind( this ); // Ensure that the additional data is being seen as a modification to the content. YoastSEO.app.registerModification( "content", callback, "MyCustomDataPlugin", 10 ); } /** * Adds to the content to be analyzed by the analyzer. * * @param {string} data The current data string. * * @returns {string} The data string parameter with the added content. */ addContent( data ) { data += "Hello, I'm some additional data!"; return data ; } } /** * Adds eventlistener to load the plugin. */ if ( typeof YoastSEO !== "undefined" && typeof YoastSEO.app !== "undefined" ) { new MyCustomDataPlugin(); } else { jQuery( window ).on( "YoastSEO:ready", function() { new MyCustomDataPlugin(); } ); }But I have no idea what should I put there on the line — addContent(data).
The example shows a hardcoded text. How can I put there a METABOX FIELD ID, for example?Any suggestions?
Thanks!
December 19, 2020 at 10:23 AM in reply to: ✅Need Help — Everything breaks in WP 5.6 — Need a hand to start debugging #23622Teia Local Studio
ParticipantJust to put a closure here — found the problem and it was not metabox related... But it worth mention, could help someone else in a similar situation.
I was using 2 filters to remove the VERSION in the enqueued scripts and styles on theme. Apparently this was the root of the problem when updating WP version with this code running.
function remove_css_js_version($src) { if (strpos($src, '?ver=')) $src = remove_query_arg('ver', $src); return $src; } add_filter('style_loader_src', 'remove_css_js_version', 9999); add_filter('script_loader_src', 'remove_css_js_version', 9999);December 19, 2020 at 3:19 AM in reply to: ✅Need Help — Everything breaks in WP 5.6 — Need a hand to start debugging #23616Teia Local Studio
ParticipantOh.
I really can't replicate the bug.
Tried on a new fresh WP install, with my theme...Nothing wrong happened.
Restored the database from the problematic one, changed back to my theme (I went to defaults for test) and the problem is gone.
Really have no idea. Perhaps some kind of JS browser cache when I updated to 5.6?
No idea.
Anyway, thanks everybody.
Moderation, feel free to lock the topic, please.December 19, 2020 at 2:46 AM in reply to: ✅Need Help — Everything breaks in WP 5.6 — Need a hand to start debugging #23615Teia Local Studio
ParticipantI believe the issue is not directly related to MetaBox itself, forgot to mention. I am just looking form some ideas, after all.
Thanks.
December 16, 2020 at 5:47 PM in reply to: ✅Problem with PO/MO in new version — labels but revert to English after saving #23570Teia Local Studio
ParticipantTHANK YOU GUYS!
Long live to META BOX family!December 16, 2020 at 3:40 AM in reply to: ✅Problem with PO/MO in new version — labels but revert to English after saving #23554Teia Local Studio
ParticipantGuys,
Any news?
There is something wrong here really indeed!Thaaanks!
G.December 8, 2020 at 9:52 PM in reply to: ✅Suggestion for fields — Automatically adding a TITLE ATRIBUTE based on MB ID #23475Teia Local Studio
ParticipantOh!
Metabox TOOLTIP. I was completely unaware of this extension. Thanks for the suggestion. Really nice indeed!
Best regards,
G.December 8, 2020 at 7:13 PM in reply to: ✅Problem with PO/MO in new version — labels but revert to English after saving #23470Teia Local Studio
ParticipantIt's important to note:
All values GET SAVED indeed. The problem is that they does not retain on the fields. If you need to edit your taxonomy or CPT you will need to write all your labels again, except for the first one (as pointed by Cedric), otherwise, on the next save, all will be reverted to English default values.
Thanks guys!
December 7, 2020 at 7:01 PM in reply to: ✅Suggestion for fields — Automatically adding a TITLE ATRIBUTE based on MB ID #23445Teia Local Studio
ParticipantThis:

And this:

=)
December 7, 2020 at 6:03 PM in reply to: ✅Suggestion for fields — Automatically adding a TITLE ATRIBUTE based on MB ID #23442Teia Local Studio
ParticipantHello, Long.
Yes yes, I understand perfectly, but I was talking about the attribute title IN A FIELD itself, not the general title of a array of fields — the whole metabox thing.
My suggestion:
<img id="my-id" src="xxx" alt="abc" TITLE="my-id" /> <input type="text" id="my-id2" size="30" TITLE="my-id2" /> <select id="my-id3" name="pick-a-boo" title="my-id3"> ... </select>What we have today:
<img id="my-id" src="xxx" alt="abc" /> <input type="text" id="my-id2" size="30" /> <select id="my-id3" name="pick-a-boo"> ... </select>It could be added on the metabox root code, however I can'r mess up the core code there, because it will me lost upon updating:
if ( class_exists( 'RWMB_Field' ) ) { class RWMB_Phone_Field extends RWMB_Field { public static function html( $meta, $field ) { return sprintf( '<input type="tel" name="%s" id="%s" value="%s" title="%s">', $field['field_name'], $field['id'], $meta, $field['id'] // <------- THIS ); } } }Well, just and idea. I found a workaround using jQuery, but it would be great to have this implemented, at least on INPUT, SELECT, TEXTAREA.
Thank you!
December 7, 2020 at 7:52 AM in reply to: ✅Suggestion for fields — Automatically adding a TITLE ATRIBUTE based on MB ID #23432Teia Local Studio
ParticipantWell,
I just accomplished a satisfactory result injecting some custom jQuery on WordPress admin. Using the code below I can force the most common fields to have a TITLE attribute based on their IDs:
jQuery('input, textarea, select, .wp-color-picker').each(function(){ jQuery(this).attr('title', jQuery(this).attr('id')); }); jQuery('.rwmb-switch').each(function(){ jQuery(this).next().attr('title', jQuery(this).attr('id')); }); jQuery('label').each(function(){ jQuery(this).attr('title', jQuery(this).attr('for')); });Hope to be useful to someone!
G.December 3, 2020 at 7:56 PM in reply to: ✅Problem with PO/MO in new version — labels but revert to English after saving #23406Teia Local Studio
ParticipantAnother problem found...
You create a CPT, change its labels to anything else than the default. They get saved (but the fields remain in default EN). Then you think, a far as I do not edit it again, its okay...
But then you access the extension to create a taxonomy, and, after creating it, the CPT got its labels all reset to default again.
Oh my.
-
AuthorPosts