• Resolved Ate Up With Motor

    (@ate-up-with-motor)


    Is it possible to change the button text for the export, change, and deletion shortcodes? I tried text=”” and that didn’t work.

    The Delete button defaults to “Close my account,” which is inappropriate for my websites because visitors do not have accounts. I’d rather set it to say “Request deletion” or something like that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Anthony Moore

    (@amooreto)

    There are some filters you can add to your theme to change this text.

    Here is an example to change the “Close my account” text:

    add_filter( 'gdpr_delete_request_form_submit_text', 'tk_change_text' );
    function tk_change_text() {
        return esc_html__( 'New Text', 'tk') ;
    }

    The other filters are:

    gdpr_export_data_request_form_submit_text

    gdpr_complaint_request_form_submit_text

    gdpr_rectify_request_form_submit_text

    Thread Starter Ate Up With Motor

    (@ate-up-with-motor)

    Thanks! Dumb question: Do I need to change the name of tk_change_text() for each separate filter?

    Plugin Author Anthony Moore

    (@amooreto)

    Yes, you can make these function names name more readable like:

    tk_change_export_data_request_form_submit_text()

    tk_change_delete_request_form_submit_text()

    You can also replace ‘tk’ with your theme slug.

    Thread Starter Ate Up With Motor

    (@ate-up-with-motor)

    Hmm — I tried the first filter like this:

    add_filter( 'gdpr_delete_request_form_submit_text', 'tk_change_delete_text' );
    function tk_change_text() {
        return esc_html__( 'Request Deletion', 'tk') ;

    … and it completely removed the button text. The button is still there, but it’s completely blank.

    Plugin Author Anthony Moore

    (@amooreto)

    Looks like there are some errors in your code, specifically the function name.

    Try this:

    add_filter( 'gdpr_delete_request_form_submit_text', 'tk_change_delete_text' );
    function tk_change_delete_text() {
        return esc_html__( 'Request Deletion', 'tk') ;
    }
    Thread Starter Ate Up With Motor

    (@ate-up-with-motor)

    Ahh! Pardon me while I slap my forehead. (I’ve been up all night working on this, and it’s starting to show.) Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Change shortcode button display text?’ is closed to new replies.