Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterDid you install the updater extension on client websites? The updater extension enables the updates of all extensions (including itself) as normal plugins.
Anh Tran
KeymasterI highly recommend to include the main plugin and extensions using the TGM Activation Class. The TGM Activation Class is being proposed to be included in WordPress core. So, we have good reasons to use it.
But, if you want to include the tab extension in your theme anyway, then you have to do 2 things:
- Include the plugin main file
- Enqueue correct CSS/JS filesYour code above only did the 1st thing. To enqueue CSS/JS file, you can do this:
add_action( 'rwmb_enqueue_scripts', 'prefix_meta_box_tabs_enqueue' ); function prefix_meta_box_tabs_enqueue() { wp_enqueue_style( 'tabs-ext', get_template_directory_uri() . '/inc/meta-box-tabs/tabs.css' ); wp_enqueue_script( 'tabs-ext', get_template_directory_uri() . '/inc/meta-box-tabs/tabs.js', array( 'jquery' ), '', true ); }Please double check the URL to files
tabs.cssandtabs.js.Anh Tran
KeymasterThank you Yumikon, I will keep a note on this.
Anh Tran
KeymasterHi Yumikom,
Unfortunately, WordPress doesn't support saving custom fields in the revision by default (even custom fields in the default Custom Fields meta box). This requires some work on that and we haven't done it yet.
Anh Tran
KeymasterThis is not a built-in feature. I think the way you're doing is correct: getting data via Ajax and use JS to populate the inputs.
We're building a premium extension for GeoCoding where the data is got from Google Maps Geocoding API via ajax and then populates all geolocation's fields. The principle is the same ๐
Anh Tran
KeymasterHi Roberto,
Can you please post your code?
Anh Tran
KeymasterHi again,
I've just updated the extension. Now it supports tabs and native WordPress style. Please see the documentation here:
https://metabox.io/docs/mb-settings-page/#section-using-tabs
Hope you like it!
March 25, 2016 at 10:52 AM in reply to: Field type->date doesn't work, for second and another group #2578Anh Tran
KeymasterHi,
Can you please try the development version on Github? We've made a big improvement for date/time fields.
I tested with 1 group which has 2 date fields and it seems to work for me:
Anh Tran
KeymasterHi Sam,
When is the data retrieved via Ajax? When editting a post?
Anh Tran
KeymasterSorry, here is the correct one:
$group_values = rwmb_meta( 'rw_mygroup' ); foreach ( $group_values as $group_value ) { echo '<div> <div class="image"><img src="' . wp_get_attachment_image_url( reset( $group_value['rw_img'] ), 'thumbnail' ) . '" /></div> <div>' . $group_value['rw_textfield1'] . '</div> <div>' . $group_value['rw_textfield2'] . '</div> <div>' . $group_value['rw_textfield3'] . '</div> </div>'; }Anh Tran
KeymasterHi aconway,
Thanks again for your contribution. I've looked at your code and it works like a charm.
The main thing here is "capture" the parent value of child field. You did that by assigning parent value to "parent_meta" key of the child field and get it back in the
child_field_metafunction. Althogh this works perfectly, this leads to a problem of redundant info as the parent value of 1 group is stored in ALL its children.So, I modified it a little by using a queue. The queue stores parent value. I use push/pop to add/retrieve parent value from the queue. Just 1 single variable to store all parent values. I think it's a little better in memory usage.
The new version 1.0.7 is just released with this. Hope you enjoy it.
Again, thanks a lot for your contribution!
Anh Tran
KeymasterThis is done!
Anh Tran
KeymasterHi, can you post your code to register meta boxes? The plugin supports all CPT, including post, of course.
Anh Tran
KeymasterHi, you're right about
rwmb_meta(). It returns the value stored in the meta value.If you want to retrieve the label, instead of value, you can use the internal helper function:
rwmb_the_value( $field_id )This function accepts the same arguments as
rwmb_metaand it displays the "meaningful" value to human.rwmb_the_value( $field_id, $args = array(), $post_id = null, $echo = true )Anh Tran
KeymasterThanks a lot, aconway! The reason it's hard to deal with is cloning. But it's still good if we have a solution for none-cloning groups. I will check your code and let you know.
-
AuthorPosts