3

Where do we go, or what do we do in order to change the default text displayed as Edit for the given function twentyseventeen_edit_link() which is originally part of the tweentyseveteen theme.

Thanks

3

The twentyseventeen_edit_link() function returns an accessibility-friendly link to edit a post or page. Here is its content:

function twentyseventeen_edit_link() {
    $link = edit_post_link(
        sprintf(
            /* translators: %s: Name of current post */
            __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
            get_the_title()
        ),
        '<span class="edit-link">',
        '</span>'
    );
    return $link;
}

Since it doesn't provide a hook or filter, you have to use PoEdit to translate Twenty Seventeen's translation files. Everything you need is included in the PoEdit official site.

  • Jack thank you so much for the insight! Is there anything wrong with replacing that function with edit_post_link('[edit this page]', '<p>', '</p>'); in your opinion? This is for my child theme. – klewis Oct 27 '17 at 13:24
  • 1
    the function twentyseventeen_edit_link() is 'pluggable' codex.wordpress.org/Pluggable_Functions therefore you can simply redefine it in functions.php of your child theme. – Michael Oct 28 '17 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.