Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterAh, you're right. I forgot to tell you that the latest version of Meta Box on Github has correct code which supports valid arguments for the filter. I will push it to wp.org so you can update the plugin now.
Anh Tran
KeymasterVersion 1.0.1 now supports changing clone button text. Please update the plugin and follow this guide.
Please let me know if you need any help.
Best regards!Anh Tran
KeymasterYour idea is interesting. At the moment, this feature has not been inplemented. I think it would be done with Javascript attached on the click event and update the Add more button class or disable attribute. I will think more about that and will imform you when it's done.
March 21, 2015 at 11:15 PM in reply to: Error Message: call_user_func() expects parameter 1 to be a valid callb #672Anh Tran
KeymasterYes, that's right. When you want to register fields with type "group", you need to activate MB Group extension, otherwise it will show the error like you saw.
Anh Tran
KeymasterAt the moment, the text for clone button is fixed. I will add a filter for you to change it in next version.
Anh Tran
KeymasterUnfortunately this is not possible at the moment. I'd suggest setting up another meta box for page template and use Include/Exclude extension to show/hide it.
Anh Tran
KeymasterOh, I see. The problem is you missed the
fieldsparameter forgroupfield. You have to do like this:'fields' => array( array( 'id' => 'group', 'type' => 'group', 'fields' => array( // you missed this parameter for group array(...), array(...), ), ), ),Anh Tran
KeymasterCool, glad it helps ๐
I'd think about order to records fields. Thanks for your idea!
Anh Tran
KeymasterAre you using
get_post_customto get post meta? Because from what you said, it looks like you display fields in the backend in one order and display fields in the frontend in another order, and as we don't have a function to list all fields in the frontend, the only way to do that I guess isget_post_customfunction.If so, I'm afraid there's no way to achieve that. The order you register fields = the order fields are displayed in the backend = the order WP processes data and stores in the DB = the order you get with
get_post_custom.Or maybe you should do something like
array_reverseas a trick before displaying fields in the frontend?Anh Tran
KeymasterHi,
I see that the problem is you use the old way to integrate theme with Meta Box plugin. It's not recommended anymore as it broke as you saw.
To eliminate this problem, please
- Remove the first block of code to include Meta Box
- Install Meta Box from wp.org as a normal plugin
- Install MB Group extension
- Register meta boxes according to this documentation (I don't see your full code so I'm not sure you're usingrwmb_meta_boxesfilter, if yes - then it's perfect, you don't need to change anything, but if no, please update the code).I wrote another documentation explaining why we should use plugin instead of included it directly in themes. Please take a look.
Best regards
Anh Tran
KeymasterAll you need to do is moving the array of the latest field to the first place in the
fieldsarray, something like in this screenshot:
Anh Tran
KeymasterHi, as we're using code to register meta boxes and fields, the only way with coding to change fields' order is changing code. There's no easier way to do that :(.
Best regards.
Anh Tran
KeymasterThe example is well-written in the extension documentation. All you need is just add
includeorexcludeparameter to meta box definition, no need to add custom function for checking like better-include demo.Anh Tran
KeymasterUnfortunately the
better-include.phpmethod uses old way to register meta boxes (viaadmin_inithook). This way still works, but you can not use it withrwmb_meta_boxesfilter, e.g. if you register meta boxes withrwmb_meta_boxesfilter, you can't usebetter-include.phpmethod.I'd suggest you use only global
$meta_boxesvariable to register meta boxes, and remove code to register meta boxes viarwmb_meta_boxesfilter.A better solution is using MB Include Exclude extension, which is tested with Group extension.
Anh Tran
KeymasterNo problem, it's quite straight forward. Try this code:
-
AuthorPosts