WordPress.org

Make WordPress Core

Ticket #10758: 10758-admin-post.patch

File 10758-admin-post.patch, 2.0 KB (added by hakre, 9 years ago)
  • wp-admin/includes/post.php

     
    915915 *
    916916 * @since unknown
    917917 *
    918  * @param unknown_type $id
    919  * @param unknown_type $title
    920  * @param unknown_type $name
    921  * @return unknown
     918 * @param int|object $id    Post ID or post object.
     919 * @param string $title (optional) Title
     920 * @param string $name (optional) Name
     921 * @return array With two entries of type string
    922922 */
    923923function get_sample_permalink($id, $title=null, $name = null) {
    924924        $post = &get_post($id);
     
    941941        // If the user wants to set a new name -- override the current one
    942942        // Note: if empty name is supplied -- use the title instead, see #6072
    943943        if (!is_null($name)) {
    944                 $post->post_name = sanitize_title($name? $name : $title, $post->ID);
     944                $post->post_name = sanitize_title($name ? $name : $title, $post->ID);
    945945        }
    946946
    947947        $post->filter = 'sample';
     
    969969}
    970970
    971971/**
    972  * {@internal Missing Short Description}}
     972 * sample permalink html
    973973 *
    974974 * @since unknown
    975975 *
    976  * @param unknown_type $id
    977  * @param unknown_type $new_title
    978  * @param unknown_type $new_slug
    979  * @return unknown
     976 * @param int|object $id Post ID or post object.
     977 * @param string $new_title (optional) New title
     978 * @param string $new_slug (optional) New slug
     979 * @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor.
    980980 */
    981 function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
     981function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {       
    982982        $post = &get_post($id);
    983         list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
     983        list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); 
    984984        if ( 'publish' == $post->post_status )
    985985                $view_post = 'post' == $post->post_type ? __('View Post') : __('View Page');
    986986