Change clone buttontext
- This topic has 5 replies, 2 voices, and was last updated 10 years, 8 months ago by
Anh Tran.
-
AuthorPosts
-
March 15, 2015 at 2:21 AM #643
pluginoven
ParticipantI would like to pass a custom value for each clone button text.
Modifying the class or language files would change all clone button text.
Is this a feature request, or did I miss something?March 17, 2015 at 3:22 PM #653Anh Tran
KeymasterAt the moment, the text for clone button is fixed. I will add a filter for you to change it in next version.
March 25, 2015 at 3:14 PM #689Anh 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!March 25, 2015 at 4:58 PM #690pluginoven
ParticipantThank you kindly! We have updated the plugin and our code and it is, in fact, working! However, we are getting the following php Warnings:
First, with meta-box-group 1.01 installed and the filter added, the following warning is displayed on the edit page where the clone-able meta-boxes are installed:
Warning: Missing argument 1 for RWMB_Group_Field::add_clone_button() in .../wp-content/plugins/meta-box-group/class-rwmb-group-field.php on line 140 Notice: Undefined variable: field in .../wp-content/plugins/meta-box-group/class-rwmb-group-field.php on line 142Fix:
We fixed this by making the following change to the add_clone_button function:static function add_clone_button( $field = '' ){ $text = apply_filters( 'rwmb_group_add_clone_button_text', __( '+ Add more', 'meta-box-group' ), $field ); return "<a href='#'' class='rwmb-button button-primary add-clone'>".$text."</a>"; }Next, with the meta-box-group plugin de-activated, we are seeing the following php warnings in all pages of the dashboard:
Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in .../wp-content/plugins/meta-box/inc/meta-box.php on line 402 Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in .../wp-content/plugins/meta-box/inc/meta-box.php on line 80will we also need to update the meta-box plugin as well?
March 25, 2015 at 10:48 PM #692Anh 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.
March 25, 2015 at 10:59 PM #694Anh Tran
KeymasterThe version 4.4.3 is now available on wordpress.org. Please update and let me know if you find any bugs.
Thanks!
-
AuthorPosts
- The topic ‘Change clone buttontext’ is closed to new replies.