Support Forum ยป User Profile

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: โœ…WMPL translate MB Blocks #41714
    info@rootscope.co[email protected]
    Participant

    OK, never mind. I've created little plugin that seems to do the trick. Just add "translate" => true to the mb fields that should be included in translations

    here's plugin https://pastebin.com/bFuu5tUk

    in reply to: โœ…WMPL translate MB Blocks #41710
    info@rootscope.co[email protected]
    Participant

    I'm dealing with the same issue. Right now I'm considering implementation of translation support
    https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocks

    any advice from MetaBox team would be appreciated ๐Ÿ˜‰

    in reply to: Output mb block from code with static data #39244
    info@rootscope.co[email protected]
    Participant

    for 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;
    }
    
    in reply to: Output mb block from code with static data #38936
    info@rootscope.co[email protected]
    Participant

    Great. Thank you

    in reply to: โœ…Option to format params #37437
    info@rootscope.co[email protected]
    Participant

    Thanks. It will be great to have this option ๐Ÿ™‚

    in reply to: โœ…Field type WYSIWYG doesn't get custom buttons #36810
    info@rootscope.co[email protected]
    Participant

    Thank 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.

    in reply to: โœ…Field type WYSIWYG doesn't get custom buttons #36799
    info@rootscope.co[email protected]
    Participant

    Hi,

    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

    in reply to: Get parsed blocks in js code #30843
    info@rootscope.co[email protected]
    Participant

    And one more question. Is there any option to globally change properties of specific Blocks through JS?

    in reply to: Content of MB Block randomly dissapear #30398
    info@rootscope.co[email protected]
    Participant

    Hi,

    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.

    in reply to: taxonomy-{taxonomy}-{term} only metabox #30360
    info@rootscope.co[email protected]
    Participant

    Thank 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;
    }
    in reply to: taxonomy-{taxonomy}-{term} only metabox #30359
    info@rootscope.co[email protected]
    Participant

    Hi,

    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?

Viewing 11 posts - 1 through 11 (of 11 total)