Change clone buttontext

Support MB Group Change clone buttontext

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #643
    pluginovenpluginoven
    Participant

    I 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?

    #653
    Anh TranAnh Tran
    Keymaster

    At the moment, the text for clone button is fixed. I will add a filter for you to change it in next version.

    #689
    Anh TranAnh Tran
    Keymaster

    Version 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!

    #690
    pluginovenpluginoven
    Participant

    Thank 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 142

    Fix:
    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 80

    will we also need to update the meta-box plugin as well?

    #692
    Anh TranAnh Tran
    Keymaster

    Ah, 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.

    #694
    Anh TranAnh Tran
    Keymaster

    The version 4.4.3 is now available on wordpress.org. Please update and let me know if you find any bugs.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change clone buttontext’ is closed to new replies.