Echoes a edit post link with some formatting.

When sections are used, there is a hidden custom field called ‘all_acf_sections’. It saves a copy of all the sections, so if you remove ACF or switch themes, you can still output the sections by outputting this field. ign_edit_link() is good to use because it is not saved to this field, so it wont output edit links.

You can add classes, and id, and text for output to the edit link.


$id: (integer) post id for the edit link

$class: (string) You can add classes to output. The class edit-link is output already for you.

$text:(string) You can change the default text of Edit to whatever you want to output.

File: inc/template-tags.php

function ign_edit_link( $id = null, $class = '', $text = 'Edit' ) {
	global $saving_sections;
	if ( $saving_sections ) {

	if ( ! $id ) {
		global $post;
		$id = $post->ID;

		/* translators: %s: Name of current post */
			__( '%s<span class="screen-reader-text"> "%s"</span>', 'ignition' ),
			$text, get_the_title()
		'<span class="edit-link">',