Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 4,786 through 4,800 (of 4,839 total)
  • Author
    Posts
  • in reply to: How to create a block that supports inner blocks? #18983
    Long NguyenLong Nguyen
    Moderator

    Hi,

    At this time the plugin does not support to create the inner block, but we are researching and developing this feature and it will be wrapped in the future update as soon as possible.

    You can also follow this guide to create the inner block by coding.

    in reply to: Feature Request: Allow icons besides Dashicons #18982
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The plugin supports to display the SVG icon beside the Dashicons, you can easily download an SVG icon from here then open the file downloaded .svg with the editor and use the SVG code.

    I'm also going to open an issue for the developer team to integrate the FA icon to the block icon.

    in reply to: Metadata Lock #18981
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I've not heard any issues like this with the site uses the Meta Box plugin. But you can increase the memory limit and execution time value by adding this code to the file wp-config.php

    define ('WP_MEMORY_LIMIT', '1500M');
    set_time_limit(30000); //below the line define('WP_DEBUG', false);

    then try to save, access the library to check the problem again.

    Let me know how it goes.

    in reply to: Mb settings not rendered in views #18980
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for contacting us.

    I'm going to check it out and let you know later.

    Long NguyenLong Nguyen
    Moderator

    Hi,

    If you use the MB Builder, please go to the Settings tab and type the name of the custom table to the box Save data in a custom table, see my screenshot

    or add the property 'table' => 'my_custom_table' if you use the code. Remember the field_id must be the same with column name.

    For more information, please follow this documentation
    https://docs.metabox.io/extensions/mb-custom-table/#using-custom-tables

    in reply to: hook action after save #18964
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can check the post or other screen by using the function get_current_screen()
    https://developer.wordpress.org/reference/functions/get_current_screen/

    and check it before generating JSON

    function post_published_notification( $meta_id, $post_id, $meta_key, $meta_value ) {
        $screen = get_current_screen();
        if( is_admin() && is_object( $screen ) ) {
            if( $screen->id == 'post' ) {
                echo "This post has been published";
                echo "<br>";
                echo rwmb_meta( $field_id );
                echo "Generate your JSON here";
            }
        }
    }
    in reply to: Select a Gravity Form to assign to a CPT #18962
    Long NguyenLong Nguyen
    Moderator

    Hi Brian,

    That means you are creating a new/custom select field and pull the GF forms (name or ID) to save with the field.

    You can try to use the sample code to create a custom select field, show the dropdown GF form name and save the ID of the form

    add_action( 'init', function() {
        if ( class_exists( 'RWMB_Field' ) ) {
            class RWMB_GForm_Select_Field extends RWMB_Field {
                public static function html( $meta, $field ) {
                    $forms = GFAPI::get_forms();
                    $html = '';
                    $html .= '<label for="' . $field['id'] . '">Choose a form:</label>
                            <select id="' . $field['id'] . '" name="' . $field['field_name'] . '">';
                    foreach ( $forms as $id => $form ) {
                        $html .= '<option value="' . $id . '">' . $form['title'] . '</option>';
                    }
                    $html .= '</select>';
                    return $html;
                }
            }
        }
    
    } );
    
    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
    
    function your_prefix_register_meta_boxes( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = array (
            'title' => esc_html__( 'Select Form', 'text-domain' ),
            'id' => 'select-form',
            'post_types' => array(
                0 => 'post',
            ),
            'context' => 'normal',
            'priority' => 'high',
            'fields' => array(
                array (
                    'id' => $prefix . 'gform_select',
                    'type' => 'gform_select',
                    'name' => esc_html__( 'Select Form', 'text-domain' ),
                ),
                
            ),
        );
    
        return $meta_boxes;
    }

    then you can show the GF form in the post content with the ID saved by getting the field value.

    For more information, please follow these documentations
    https://docs.gravityforms.com/adding-a-form-to-the-theme-file/
    https://docs.metabox.io/custom-field-type/

    Long NguyenLong Nguyen
    Moderator

    Hi,

    The field Taxonomy Advanced only saves the value in the post meta (table wp_postmeta).

    The field Taxonomy does not store value in the post meta, it sets posts term like category and tag (table wp_term_relationships). The purpose of this field is to replace the default WordPress meta box for taxonomy and offer more options to control how it displays.

    For more information, please follow this documentation
    https://docs.metabox.io/fields/taxonomy-advanced/
    https://docs.metabox.io/fields/taxonomy/

    Long NguyenLong Nguyen
    Moderator

    Hi,

    We are checking this and will let you know when it has done.

    Thank you and have a nice day.

    in reply to: PHP Notice: Trying to get property 'id' of non-object #18958
    Long NguyenLong Nguyen
    Moderator

    Hi Drake,

    Something goes wrong with the function get_current_screen() and it does not return a screen object which always has the property id.

    Please try to edit the file /wp-content/plugins/metabox-meta-box-aio/vendor/meta-box/mb-user-meta/src/DuplicatedFields.php and check the object $screen on line 31, the code should be

    $screen = get_current_screen();
    if( ! is_object( $screen ) ) {
        return $html;
    }

    Then clear the log and edit the block again. Let me know how it goes.

    Long NguyenLong Nguyen
    Moderator

    Hi,

    It is impossible and easier when you create MB Custom Table and use custom fields as the post type support (post content, excerpt, featured image ...) then save the custom fields to the custom table.

    You can use the hook remove_post_type_support to remove the post type support and only shows the custom fields.

    For more information, please follow the documentation https://docs.metabox.io/extensions/mb-custom-table/

    in reply to: hook action after save #18954
    Long NguyenLong Nguyen
    Moderator

    Hi,

    After a few hours of researching, I've found a hook to fire after the metadata is saved updated_postmeta, please follow the documentation and the sample code

    add_action( 'updated_postmeta', 'post_published_notification', PHP_INT_MAX, 4 );
    
    function post_published_notification( $meta_id, $post_id, $meta_key, $meta_value ) {
        echo "This post has been published";
        echo "<br>";
        echo rwmb_meta( $field_id );
        echo "Generate your JSON here";
        die();
    }
    

    Please try again and let me know how it goes.

    in reply to: hook action after save #18942
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can follow this documentation to use the action save_post which is fired whenever a post or page is created or updated, include the meta data (field value) saved.

    Try to run the action with the sample code below

    add_action( 'save_post', 'post_published_notification', 999, 3 );
    
    function post_published_notification( $post_id, $post, $update ) {
        echo "This post has been published";
        echo "<br>";
        echo rwmb_meta( $field_id );
        echo "<br>";
        echo "Generate your JSON here";
        die();
    }
    in reply to: std value for radio not considered on clone #18938
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I've tested the default value with the cloneable items and realize it is a bug. I also open an issue for the developer team to fix this bug in the next update as soon as possible.

    Thanks for your patience.

    Long NguyenLong Nguyen
    Moderator

    Hi,

    Because the field Image Advanced always returns the array of the image info so we cannot use the shortcode [rwmb_meta] to show the first image. If you want to create your own shortcode, please follow this documentation and follow our guide.

    Let me know if you have any questions.

Viewing 15 posts - 4,786 through 4,800 (of 4,839 total)