Forum Replies Created
-
AuthorPosts
-
March 10, 2023 at 2:32 AM in reply to: Can't erase COLOR input content even with keyboard DELETE KEY #40931
Teia Local Studio
ParticipantOH MY.
SOLVED!
I can't believe I spent a whole morning trying to find a solution... for something was not broken!
OUCH! It seems I just need to set the color mode in all my COLOR metaboxes! Doing it, fixed the problem.array( 'name' => __('Cor de fundo geral do menu', 'tl'), 'id' => 'visual-menu-cor-bg', 'type' => 'color', 'desc' => __('Padrão: Preto', 'tl'), 'alpha_channel' => true, 'columns' => 12, 'js_options' => array( 'mode' => 'hex' ), ),QUESTION:
Is that possible to make a safe call if the setting is missing? (In the COLOR.JS). If not present it breaks again. I will need to navigate in all my theme boxes to correct this... and worse, in several online/production websites, one by one, to add the JS_OPTIONS["mode"]["hex"]...
Or, can someone guide me to correct it injecting some JS in the ADMIN side? I tried injecting the following, but it did not help.
Inside a custom JS I have enqueued on ADMIN:
jQuery('.rwmb-color').iris({ mode: 'hex', });Thanks, guys!
March 10, 2023 at 2:04 AM in reply to: Can't erase COLOR input content even with keyboard DELETE KEY #40930Teia Local Studio
ParticipantUPDATE:
I was able to track down the root of the problem. It has something to do with lines 12, 13, 14, and 15 in COLOR.JS, inside META-BOX/JS/ (version 5.6.17).
function triggerChange() { if ( null !== mode && 'hex' !== mode ) { const color = new Color( $this.iris( 'option', 'color' ) ); <strong>!!!! HERE ------></strong> $this.val( color.toCSS( mode ) ); } $this.trigger( 'color:change' ).trigger( 'mb_change' ); }If I remove/comment the line --- $this.val( color.toCSS( mode ) ); --- everything starts working fine again with my COLOR metaboxes.
Am I missing something in the metabox COLOR call? Some parameter? OPTION? The documentation does not mention anything like that.
March 10, 2023 at 1:26 AM in reply to: Can't erase COLOR input content even with keyboard DELETE KEY #40929Teia Local Studio
ParticipantUPDATE:
I can't get COLOR metabox to work correctly even in a BRAND NEW WordPress setup 6.1.1 with ONLY METABOX 5.6.17 and default themes like TWENTY-TWENTY-ONE, TWO or THREE.
No custom modifications, no custom hacks, nothing disabled. Just a out of the box setup...
I am using this code to call a COLOR test metabox:
<?php add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) { $meta_boxes[] = [ 'title' => 'Metabox Test', 'post_types' => 'post', 'context' => 'side', 'fields' => [ [ 'name' => 'Color', 'id' => 'my-color', 'type' => 'color', 'alpha_channel' => true ], ], ]; return $meta_boxes; } ); ?>Teia Local Studio
ParticipantHello, Peter.
Yes, yes, I have a RED string set there.
I will remove it and test again, and post the result here.Thanks so far!
G.Teia Local Studio
ParticipantI confirm the error. The same form me. Exactly the same. However, inspecting the code of the referred file, it seems to be OK.
Can you guys check it out? Since I have several sites it seems the problem will start to cascade on all of them, since every metabox plugin is set to auto update!
Thank you!
EDIT: OH, just saw the last comma on the line #53!
Removing it fix the problem indeed.June 22, 2021 at 7:03 PM in reply to: ✅Meta data being displayed twice (duplicated) on each admin column #29065Teia Local Studio
ParticipantDear Long,
As soon as I get some free time I will post here.
I'm in a rush now.Thanks until now.
See you soon!
G.March 27, 2021 at 9:49 PM in reply to: ✅Simple HTML code on RADIO/CHECKLIST labels is not working anymore #26748Teia Local Studio
ParticipantYES!
Problem SOLVED.
Thank you as always for your prompt help!Regards,
Giovani.Teia Local Studio
ParticipantHi Anh,
I updated to MB AIO 1.13.0 in my recent site (custom theme) and the problem DID NOT RETURN. Everything IS FINE for me. I think it could be interesting to report.
Thanks always!
G.January 15, 2021 at 6:54 PM in reply to: ✅Is the "plugin auto update" feature working for MB AIO? #24041Teia Local Studio
ParticipantYes yes, super crystal clear information.
I was aware of it, thanks anyway!But what I meant was... Only in MB AIO, sometimes, the "Enable auto-updates" disappears. It is not there. Just wanted to check if this is expected, or some weird behavior.
WP 5.6
All up to date.
The MB AIO Auto Update link WAS there... Before I update manually.
Usually, on new sites, I do update manually, and then after it, turn it ON the AUTOMATIC proccess. But JUST FOR -> MB AIO, the link disappears.If this is normal, OK, never mind. I can use the filter.
Just wanted to inform you guys, in case of a possible tiny bug somewhere.THANKS!
Teia Local Studio
ParticipantIt's all fixed for me too!
Five stars are not enough, you and MB team deserves 10 stars, in gold!
Thank you, Ahn!Giovani.
Teia Local Studio
ParticipantHej there!
Updating only the .JS solved my problems with the editor rendering in classic mode!
Thank you!However, updating the .PHP file brings also to me — as reported by JC — the strange bug on VISUAL text input —— the ENTER KEY must be pressed twice to create a paragraph (or CTRL+ENTER twice for line breaks).
Always thank you, Ahn & Team!
G.Teia Local Studio
ParticipantAhn,
I use only — and solely — the classic editor, everywhere. The GutenBerg Block Editor is not an option to me. I turn it off completely on my themes.
So, as for now, I will change the value to 100 and I will wait for your final word on this.
For curiosity — Do you think is it possible to modify the delay value using a external JS file loaded on admin using add_action('admin_enqueue_scripts', ...);??
Thanks so much for your always prompt help!
G.Teia Local Studio
ParticipantUpdate:
I tried including the WYSIWYG metabox in my theme using both ways, the regular method and with a IF/ELSE/$post_id condition (as mentioned above):
— Removed my custom snippet for blank <p>'s, it was not it the culprit, problem still there
— Emptied the cache, nothing
— When screen reloads, after saving, I see the visual editor on the VISUAL tab for a millisecond, then it disappears, like if it was a refresh applied on the elementSo, tried to inspect the new WYSISYG.JS file you shared this morning and solved my problem by commenting/removing the following:
// Force re-render editors. Use setTimeOut to run after all other code. Bug occurs in WP 5.6. $( function() { setTimeout( function() { $( '.rwmb-wysiwyg' ).each( transform ); }, 0 ); } );But of course, this is not a ideal solution.
I tried also changing the number param of the setTimeout function... Anything higher than 12, 13, solves the problem. Putting like 20 or even 999 works too.But again, not ideal.
Oh my...
=(IN TIME: No JS errors show up in the console.
Teia Local Studio
ParticipantOuch.
I think I found out the problem.
I have a snippet of code in my functions to FORCE REMOVE of EMPTY <p>'s. It seems this is what is causing me trouble. If so ----> YES, your current new WYSIWYG.JS is fixing the problem.
function remove_empty_p( $content ){ // clean up p tags around block elements $content = preg_replace( array( '#<p>\s*<(div|aside|section|article|header|footer)#', '#</(div|aside|section|article|header|footer)>\s*</p>#', '#</(div|aside|section|article|header|footer)>\s*<br ?/?>#', '#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#', '#<p>\s*</(div|aside|section|article|header|footer)#', ), array( '<$1', '</$1>', '</$1>', '<$1$2>', '</$1', ), $content ); return preg_replace('#<p>(\s| )*+(<br\s*/*>)*(\s| )*</p>#i', '', $content); } add_filter( 'the_content', 'remove_empty_p', 20, 1 );I will test a bit more and will return soon.
Need to leave the house for a moment.Teia Local Studio
ParticipantHello Ahn!
No, it is not working for me (although I have not tested on a clean default themed WordPress). Behavior:
If I open a post with already WYSIWYG content on it, the VISUAL tab do not load at all, just the CODE tab.
If I create a brand new post and add content, in VISUAL all is OK, I can write and yes, I can switch between CODE and VISUAL again. But in the moment I do save the post and screen reloads, the VISUAL is completely gone (I mean the textarea editor field too), but code is there.
On this very recent post, if I SHIFT+Refresh, the VISUAL field is back on track, however the content on it is rendered all in white color (can't see anything unless I select with mouse) and it is formatted in HTML, I can see the <p> tags, etc etc, exactly as the same on CODE tab.
Note: the meta-data IS saved correctly to the database.
But my theme situation could be interfering perhaps... I do register the metabox based on a IF/ELSE who looks what $POST_ID is being edited. It's something I needed to do in my theme for other reasons:
$post_id = null; if ( isset( $_GET['post'] ) ) { $post_id = intval( $_GET['post'] ); } elseif ( isset( $_POST['post_ID'] ) ) { $post_id = intval( $_POST['post_ID'] ); } if ($post_id == 111) { $meta_boxes[] = array( 'id' => 'mb-for-post-111', (...) ); } else { $meta_boxes[] = array( 'id' => 'mb-for-other-posts', (...) ); }ALSO: I do erradicate anything related to GutenBerg on my themes. Using the plagued new editor is absolutely no option for me. I run this code to remove it:
// Begone, GutenBerg! add_filter('use_block_editor_for_post_type', '__return_false', 10); // Don't load GutenBerg-related stylesheets. add_action( 'wp_enqueue_scripts', 'remove_block_css', 100 ); function remove_block_css() { wp_dequeue_style( 'wp-block-library' ); // WordPress core wp_dequeue_style( 'wp-block-library-theme' ); // WordPress core wp_dequeue_style( 'wc-block-style' ); // WooCommerce wp_dequeue_style( 'storefront-gutenberg-blocks' ); // Storefront theme }I will try in a matter of minutes your new JS including the metabox on a standard way (yet on my theme) and also on a regular clean WordPress install, with the default theme.
See you soon.
Thanks so far. -
AuthorPosts