Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: edit_form_before_permalink

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

Line Code
498 </div>
499 <?php
500 /**
501  * Fires before the permalink field in the edit form.
502  *
503  * @since 4.1.0
504  *
505  * @param WP_Post $post Post object.
506  */
507 do_action( 'edit_form_before_permalink', $post );
508 ?>
509 <div class="inside">
510 <?php
511 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
512 $shortlink = wp_get_shortlink($post->ID, 'post');
513
514 if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
515     $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
516