Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterYou can use this code:
$metaBackgroundImage = rwmb_meta( 'socialityandydote_background_image' ); $metaBackgroundImage = empty( $metaBackgroundImage ) ? '' : reset( $metaBackgroundImage );This takes the first image from the returned array. Then you can use it without the foreach loop.
Anh Tran
KeymasterJust tried your code and 48 shows up as default value for me. Please note that it works only for the posts where the meta box hasn't been saved. You can check it with new posts.
Anh Tran
KeymasterThis is resolved on Github: https://github.com/rilwis/meta-box/issues/1001.
Anh Tran
KeymasterLooks like the regex pattern matches the wrong position. I will take a look at that.
Thanks for letting me know.
Anh Tran
KeymasterNo problem, here you are:
<?php $prefix = ''; $sectors = rwmb_meta( "{$prefix}sector" ); if ( ! empty( $sectors ) ) { foreach ( $sectors as $sector ) { $sector_heading = isset( $sector["{$prefix}sector-heading"] ) ? $sector["{$prefix}sector-heading"] : ''; echo $sector_heading; $sector_title = isset( $sector["{$prefix}sector-title"] ) ? $sector["{$prefix}sector-title"] : ''; echo $sector_title; $objects = isset( $sector["{$prefix}sector-object"] ) ? $sector["{$prefix}sector-object"] : array(); foreach ( $objects as $object ) { $object_img = isset( $object["{$prefix}sector-object-img"] ) ? $object["{$prefix}sector-object-img"] : ''; if ( $object_img ) { echo '<img src="' . wp_get_attachment_image_url( $object_img, 'size' ) . '">'; } $object_desc = isset( $object["{$prefix}sector-object-description"] ) ? $object["{$prefix}sector-object-description"] : ''; echo $object_desc; } } }Anh Tran
KeymasterAwesome features and links. I will make a note.
Anh Tran
KeymasterThat also works :). Remember to
strip_tagson the frontend when you retrieve the meta value ๐Anh Tran
KeymasterI can't access that page. It's your internal admin page. So, the problem is how that page exports/imports content. I think it doesn't relates to Meta Box. Please try deactivate the text limiter extension and try again.
Anh Tran
KeymasterYes, that's right. Each purchase lets you get support and updates for 1 year. Please read more in the FAQ.
Anh Tran
KeymasterHi,
I think the only way to do that is using custom CSS, something like this:
input[type="checkbox"][value="xxx"] { background: url(image.jpg); }By default, the plugin outputs the checkbox only and CSS is the only way I think can resolve this.
Edit: Sorry, I was thinking about normal checkbox fields built without the Builder. I think the Builder don't have such feature.
Anh Tran
KeymasterJust curious, why do you need to store slug instead of ID?
Anh Tran
KeymasterHi,
You can run the following code:
$option = get_option( 'option_name' ); $option[$field_id] = $new_value; update_option( 'option_name', $option );Anh Tran
KeymasterHmm, it might relates with the way you register meta boxes. In 4.9.x, the biggest change is the WPML compatibility, which **forces** Meta Box to use
initaction to register meta boxes instead of previousadmin_init.So, if you wrap your code like this:
add_action( 'init', 'your_function' ); function your_function() { add_filter( 'rwmb_meta_boxes', 'slug_register_meta_boxes' ); }where
initor any other hook is used, please change it to:add_filter( 'rwmb_meta_boxes', 'slug_register_meta_boxes' );I'm not sure if that's the correct problem, but some people meet it, so I guess you do. Please check your code for that.
Anh Tran
KeymasterHi, the plugin doesn't restrict on the content length displayed in the front end. It might be your PHP function that gets the content and displays it. Please check this.
Anh Tran
KeymasterI've just released the new version 1.2.5 for this. Please update the extension.
Sorry for the delay.
-
AuthorPosts