Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_sample_permalink_html

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1072      }
1073
1074      if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
1075           $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n";
1076           if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
1077                $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
1078           if ( isset( $view_post ) )
1079                $return .= "<span id='view-post-btn'><a href='$permalink' class='button button-small'>$view_post</a></span>\n";
1080
1081           $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
1082
1083           return $return;
1084      }
1085
1086      if ( function_exists('mb_strlen') ) {
1087           if ( mb_strlen($post_name) > 30 ) {
1088                $post_name_abridged = mb_substr($post_name, 0, 14). '&hellip;' . mb_substr($post_name, -14);
1089           } else {
1090                $post_name_abridged = $post_name;
 
Line Code
1102      $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
1103      $return =  '<strong>' . __('Permalink:') . "</strong>\n";
1104      $return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
1105      $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
1106      $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";
1107      $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
1108      if ( isset($view_post) )
1109           $return .= "<span id='view-post-btn'><a href='$view_link' class='button button-small'>$view_post</a></span>\n";
1110
1111      $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
1112
1113      return $return;
1114 }
1115
1116 /**
1117  * Output HTML for the post thumbnail meta-box.
1118  *
1119  * @since 2.9.0
1120  *