- $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
- $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
- $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
- $return = '<strong>' . __('Permalink:') . "</strong>\n";
- $return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
- $return .= '‎'; // Fix bi-directional text display defect in RTL languages.
- $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
- $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
- if ( isset($view_post) )
- $return .= "<span id='view-post-btn'><a href='$view_link' class='button button-small'>$view_post</a></span>\n";
-
- $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
+ /**
+ * Filter the sample permalink HTML markup.
+ *
+ * @since 2.9.0
+ *
+ * @param string $return Sample permalink HTML markup.
+ * @param int|WP_Post $id Post object or ID.
+ * @param string $new_title New sample permalink title.
+ * @param string $new_slug New sample permalink slug.
+ */
+ $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug );