WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 1022 | } |
| 1023 | |
| 1024 | if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { |
| 1025 | $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n"; |
| 1026 | if ( current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) |
| 1027 | $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n"; |
| 1028 | if ( isset($view_post) ) |
| 1029 | $return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n"; |
| 1030 | |
| 1031 | $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); |
| 1032 | |
| 1033 | return $return; |
| 1034 | } |
| 1035 | |
| 1036 | if ( function_exists('mb_strlen') ) { |
| 1037 | if ( mb_strlen($post_name) > 30 ) { |
| 1038 | $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14); |
| 1039 | } else { |
| 1040 | $post_name_abridged = $post_name; |
| Line | Code |
| 1050 | $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>'; |
| 1051 | $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); |
| 1052 | $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink); |
| 1053 | $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $display_link . "</span>\n"; |
| 1054 | $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n"; |
| 1055 | $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n"; |
| 1056 | if ( isset($view_post) ) |
| 1057 | $return .= "<span id='view-post-btn'><a href='$view_link' class='button' target='_blank'>$view_post</a></span>\n"; |
| 1058 | |
| 1059 | $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); |
| 1060 | |
| 1061 | return $return; |
| 1062 | } |
| 1063 | |
| 1064 | /** |
| 1065 | * Output HTML for the post thumbnail meta-box. |
| 1066 | * |
| 1067 | * @since 2.9.0 |
| 1068 | * |