Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Dave,
I've just pushed a commit on Github to add supports for this. Please download the development version here: https://github.com/rilwis/meta-box (I will update the plugin a little bit later).
Instead of "move" description under the label, you just need to add parameter
label_descriptionto the field and that's done.Anh Tran
KeymasterHi Dave,
This feature is not available yet in Meta Box. It's still being developed. We have some technical issues that relates with the core and need to fix it.
I will let you know when it's available.
Anh Tran
KeymasterHi,
1. You need to put this code in the meta box parameters, for more info, please read this docs:
https://metabox.io/docs/validation/
2. The current version of Meta Box only supports validating fields when editing posts/pages. I've made and improvement to support user meta and term meta. That feature is available on Github: https://github.com/rilwis/meta-box. I will update the plugin a little bit later when we fix some other bugs.
Anh Tran
KeymasterHi,
I've just checked the CSS of the rows and found that the CSS you're seeing is in the old version of the extension. Please update the extension to have that fixed.
Anh Tran
KeymasterHi,
I think you can do like this in your plugin:
$options = array( 'ea' => 'Each', 'hr' => 'Hourly', 'day' => 'Daily', 'wk' => 'Weekly', 'mth' => 'Month', 'yr' => 'Yearly', ); $options = apply_filters( 'prefix_unit_options', $options );Then when registering meta boxes, just specify
'options' => $options.It might be a better idea to wrap the value of options to a function like:
function prefix_get_unit_option() { $options = ...; return apply_filters( 'prefix_unit_options', $options ); }And use
'options' => prefix_get_unit_option().This way you can make a repeatable field in your settings page and get the values, passing them to the
prefix_get_unit_option()to build the array of options.function prefix_get_unit_option() { $options = ...; // Default options $settings = get_option( 'option_name' ); if ( ! empty( $settings['unit_options'] ) ) { foreach ( $settings['unit_options'] as $value => $label ) { $options[$value] = $label; } } return apply_filters( 'prefix_unit_options', $options ); }Anh Tran
KeymasterGreat link! Thanks for letting me know. I will check that.
Anh Tran
KeymasterHi Dave,
I've just tried the Admin Columns free version and it finds registered fields. What field types are you using? Because of different ways of storing data in the post meta, I think this plugin works only with the basic field types (such as text, wysiwyg, select, radio, etc.).
Anh Tran
KeymasterLooks like a compatibility with PHP 5.2. I've updated the extension, please try again.
Anh Tran
KeymasterA simple solution is creating 2 meta boxes: 1 for your
testtypewhere you use$content, 1 for the other post type.Anh Tran
KeymasterI've seen Jetpack plugin do that. Not sure if there's any solution in general for that.
Anh Tran
KeymasterI couldn't replicate the issue. Here is my screencast:
Anh Tran
KeymasterJust looked at the issue and found that WordPress doesn't validate the user edit form. So the
requiredattribute doesn't work.You need to use Validation rules, like this:
'validation' => array( 'rules' => array( $prefix . 'structure_name' => array( 'required' => true, ), ), )However, this requires the latest development version on Github. I've just added support for user edit form and term edit form in the core.
Anh Tran
KeymasterHi, I couldn't replicate the bug. Can you post your code to register meta boxes?
Anh Tran
KeymasterThe WordPress core doesn't support that. We need to create a custom code for that. I will update the plugin to support that soon.
Anh Tran
KeymasterHi,
A. Is my basic view of what Metabox can do right?
The plugin only does the job of creating meta boxes and custom fields in the admin area. It doesn't handle the automatic showing the custom fields values in the frontend (because it depends on where you want to show them or how you want to use them).
I think it's half of what you want.
B. How do I get the customer fields visible in the frontend?
Please follow this documentation: https://metabox.io/docs/get-meta-value/
This was the text of the notice with the fatal error:
Can you give me more details on the error?
-
AuthorPosts