Support Forum » User Profile

Forum Replies Created

Viewing 13 posts - 3,706 through 3,718 (of 3,718 total)
  • Author
    Posts
  • in reply to: Images are note being displayed from Custom Table #38957
    PeterPeter
    Moderator

    Hello Md Wasim,

    I will take care of this topic from now. On the archive page, you can use the WordPress function get_queried_object_id() to get the term ID and pass it to the helper function rwmb_meta() as you do above.

    $term_id = get_queried_object_id()
    $image_id = rwmb_meta( 'author_single_image', $args, $term_id );
    PeterPeter
    Moderator

    Hello Jacob,

    It looks like you want to add one instance of MB test block on a post/page and allow other blocks added. Please use the setting supports with multiple set to false.

    'supports' => [
        // Use the block just once per post
        multiple: false,
    ],
    in reply to: do_shortcode returns nothing in AJAX call #38950
    PeterPeter
    Moderator

    Hello there,

    It is not possible to render the frontend shortcode via AJAX call because the CSS and JS files will not be loaded along with the HTML code. Please use the shortcode on the page load only to make the shortcode render correctly.

    PeterPeter
    Moderator

    Hello Jason,

    Thanks for following up.

    The issue has been added to the development queue and our team will work on this in a short time. I will keep you updated on this issue.

    in reply to: display relationships to each post in list of cpt #38948
    PeterPeter
    Moderator

    Hello Jimimac,

    A similar code works as well on my local site

    $loop = new WP_Query(
    	array(
        	'post_type' => 'page',
        	'posts_per_page' => 5,
        	'order' => 'ASC'
    		)
    );
    while ( $loop->have_posts() ) : $loop->the_post();
    	echo the_title();
    	echo '<br/>';
    	$contacts = MB_Relationships_API::get_connected( [
    		'id'   => 'page-to-post',
    		'from' => get_the_ID(),
    	] );
    	foreach ( $contacts as $c ) {
    		echo $c->post_title;
    	}			
    endwhile;
    wp_reset_postdata();

    so please recheck the relationship ID and the from side when registering the relationship on your site.

    in reply to: Holding fields for review #38947
    PeterPeter
    Moderator

    After a post is submitted successfully on the frontend, the custom field value is already saved to the custom table (if you choose to save the custom table), not waiting to approve. Then it is not possible to move the field value to the default table wp_postmeta because the field is registered to get the value from the custom table.

    in reply to: Hiding default editor (Gutenberg or not) #38946
    PeterPeter
    Moderator

    Hello Chris,

    You can use this PHP code to remove the editor if you want

    // Remove the editor. Change 'post' to your custom post type.
    add_action( 'init', function () {
        remove_post_type_support( 'post', 'editor' );
    } );

    Read more on the documentation https://docs.metabox.io/save-wysiwyg-content-post-content/

    in reply to: User met not saving #38938
    PeterPeter
    Moderator

    Hello,

    Can you please check the value in the database if the field saved the correct value? If not, please share the PHP code that registers the user meta field, I will try to reproduce the issue on my demo site.

    in reply to: Insert custom post type shortcode into header #38937
    PeterPeter
    Moderator

    Hello there,

    There is an error when using the single quote in your code, it should be

    echo do_shortcode('[mb_frontend_form id="url" post_fields="title,content"]');
    
    in reply to: Holding fields for review #38934
    PeterPeter
    Moderator

    Hello Amy,

    To manually review the post before publishing it, you can simply use the attribute post_status of the frontend form shortcode [mb_frontend_form id="field-group-id" post_fields="title,content" post_status="pending"].

    If you want to do something after saving the post, please try to use the hook rwmb_frontend_after_save_post or rwmb_frontend_after_process

    in reply to: Image Advanced not getting IDs from cloneable field #38933
    PeterPeter
    Moderator

    Hello there,

    If you set the field image_advanced as a cloneable field, you will need to use 2 for loop to get the image ids. Here is an example:

    $advanced_images = rwmb_meta( 'image_advanced_wyyzp67zec' );
    $image_ids = [];
    foreach ( $advanced_images as $advanced_image ) {
    	foreach ( $advanced_image as $key => $image ) {
    		array_push( $image_ids, $key );
    	}
    }
    $shortcode = '[' . 'gallery ids="' . implode( ',', $image_ids ) . '" itemtag="div" icontag ="div" size="thumbnail" link="file"]';
    
    in reply to: Getting object ID #38932
    PeterPeter
    Moderator

    Hello Yasmine,

    Can you please let me know the full scenario in this case? If you use this code

    $term_id = get_queried_object_id();
    $value = rwmb_meta( $my_custom_field_id, ['object_type' => 'term'], $term_id );

    It will work on the archive term page and get the term meta. But you also refer to this code

    $was_interview = get_post_meta( $post->ID, 'summary-made', true );

    which only works on the post page or in the WP Query loop.

    in reply to: Output mb block from code with static data #38931
    PeterPeter
    Moderator

    Hello there,

    Currently, MB Block does not support passing data to a function to render the custom block like that. I will inform the development team to explore the possibility.

Viewing 13 posts - 3,706 through 3,718 (of 3,718 total)