Forum Replies Created
-
AuthorPosts
-
[email protected]
ParticipantOK, never mind. I've created little plugin that seems to do the trick. Just add
"translate" => trueto the mb fields that should be included in translationshere's plugin https://pastebin.com/bFuu5tUk
[email protected]
ParticipantI'm dealing with the same issue. Right now I'm considering implementation of translation support
https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocksany advice from MetaBox team would be appreciated ๐
[email protected]
Participantfor anyone with this problem theese functions seems to work pretty well
// render meta block with provided data function rwmb_meta_render_block($id, $data, $className = null, $echo = true) { $block = [ "blockName" => "meta-box/" . $id, "attrs" => [ "id" => "mb-block-" . wp_hash(microtime()), "data" => $data, "className" => $className, ], "innerBlocks" => [], "innerHtml" => "", "innerContent" => [], ]; $html = render_block($block); if ($echo) { echo $html; } return $html; } // render reusable block function rwmb_meta_render_reusable($block_name, $echo = true) { global $wpdb; $html = ""; $block_id = $wpdb->get_var("SELECT ID from {$wpdb->posts} WHERE post_type='wp_block' AND post_name='{$block_name}'"); if ($block_id) { $attributes = [ "ref" => $block_id, ]; $html = render_block_core_block($attributes); if ($echo) { echo $html; } } return $html; }[email protected]
ParticipantGreat. Thank you
[email protected]
ParticipantThanks. It will be great to have this option ๐
[email protected]
ParticipantThank you. And i want to ask you, if i set options plugin to use table and insert plugin js file into wp-includes/js/tinymce/plugins/table ... it loads the plugin but it throws an error Failed to initialize plugin: table TypeError: r is not a constructor. I know that this issue is not from Metabox, i just ask if you have some correct example of use table plugin.
[email protected]
ParticipantHi,
it is not because of third-party plugin support. For example if i add this hook:
add_filter('mce_buttons_2', 'custom_mce_buttons'); function custom_mce_buttons($buttons) { $buttons[] = 'subscript'; $buttons[] = 'superscript'; return $buttons; }it works in classic editor when i add new page (see attached file): https://prnt.sc/NlqhFy3pKCgQ
but when i add some MB Block with wysiwyg editor this buttons are not there (see attached file): https://prnt.sc/vVKqRbUpLv1N[email protected]
ParticipantAnd one more question. Is there any option to globally change properties of specific Blocks through JS?
[email protected]
ParticipantHi,
so i finally find out pattern which create this bug. At this link is a video of bug: https://files.fm/f/bbtee8yf7
You can see that there are two custom MB Blocks and when i click on one of them and wait for loading it is ok. But once i click on first and immediatelly click on second (without waiting for load) it removes content of first one.[email protected]
ParticipantThank you for hint.
add_filter( 'rwmb_meta_boxes', 'prefix_register_taxonomy_meta_boxes' ); function prefix_register_taxonomy_meta_boxes( $meta_boxes ){ $meta_boxes[] = array( ... 'taxonomies' => array('poschodia_retail'), // THIS: List of taxonomies. Array or string 'fields' => array( array( 'name' => 'Featured Content', 'id' => 'featured_content', 'type' => 'wysiwyg', // 'visible' => array( 'tag_ID', 22 ), 'visible' => array( 'slug', '1-poschodie' ), ), ), ); return $meta_boxes; }[email protected]
ParticipantHi,
taxonomies setting is already in code, but I want to find a way how to show metabox only in one taxonomy term. For example I have taxonomy called "taxonomy". In this taxonomy I have two terms - "taxonomy-term1" and "taxonomy-term2". I need to show metabox only on term called "taxonomy-term1". Is there any way to do it?
-
AuthorPosts