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
1203            * Filter the sample permalink HTML markup.
1204            *
1205            * @since 2.9.0
1206            *
1207            * @param string      $return    Sample permalink HTML markup.
1208            * @param int|WP_Post $id        Post object or ID.
1209            * @param string      $new_title New sample permalink title.
1210            * @param string      $new_slug  New sample permalink slug.
1211            */
1212           $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug );
1213
1214           return $return;
1215      }
1216
1217      if ( function_exists('mb_strlen') ) {
1218           if ( mb_strlen($post_name) > 30 ) {
1219                $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14);
1220           } else {
1221                $post_name_abridged = $post_name;
 
Line Code
1236      $return .= '‎'; // Fix bi-directional text display defect in RTL languages.
1237      $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";
1238      $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
1239
1240      if ( isset( $view_post ) ) {
1241           $return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n";
1242      }
1243
1244      /** This filter is documented in wp-admin/includes/post.php */
1245      $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug );
1246
1247      return $return;
1248 }
1249
1250 /**
1251  * Output HTML for the post thumbnail meta-box.
1252  *
1253  * @since 2.9.0
1254  *