diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index ae881e3795..b87269d64e 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1192,61 +1192,36 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { $title = __('Temporary permalink. Click to edit this part.'); } - if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { + if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) { $return = '' . __('Permalink:') . "\n" . '' . $permalink . "\n"; if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) { $return .= '' . __('Change Permalinks') . "\n"; } - - if ( isset( $view_post ) ) { - if( 'draft' == $post->post_status ) { - $preview_link = set_url_scheme( get_permalink( $post->ID ) ); - /** This filter is documented in wp-admin/includes/meta-boxes.php */ - $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ); - $return .= "$view_post\n"; + } else { + if ( function_exists( 'mb_strlen' ) ) { + if ( mb_strlen( $post_name ) > 30 ) { + $post_name_abridged = mb_substr( $post_name, 0, 14 ) . '…' . mb_substr( $post_name, -14 ); } else { - $return .= "$view_post\n"; + $post_name_abridged = $post_name; + } + } else { + if ( strlen( $post_name ) > 30 ) { + $post_name_abridged = substr( $post_name, 0, 14 ) . '…' . substr( $post_name, -14 ); + } else { + $post_name_abridged = $post_name; } } - /** - * Filter the sample permalink HTML markup. - * - * @since 2.9.0 - * - * @param string $return Sample permalink HTML markup. - * @param int|WP_Post $id Post object or ID. - * @param string $new_title New sample permalink title. - * @param string $new_slug New sample permalink slug. - */ - $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug ); + $post_name_html = '' . $post_name_abridged . ''; + $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, $permalink ); - return $return; + $return = '' . __( 'Permalink:' ) . "\n"; + $return .= '' . $display_link . "\n"; + $return .= '‎'; // Fix bi-directional text display defect in RTL languages. + $return .= '' . __( 'Edit' ) . "\n"; + $return .= '' . $post_name . "\n"; } - if ( function_exists('mb_strlen') ) { - if ( mb_strlen($post_name) > 30 ) { - $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14); - } else { - $post_name_abridged = $post_name; - } - } else { - if ( strlen($post_name) > 30 ) { - $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); - } else { - $post_name_abridged = $post_name; - } - } - - $post_name_html = '' . $post_name_abridged . ''; - $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); - - $return = '' . __('Permalink:') . "\n"; - $return .= '' . $display_link . "\n"; - $return .= '‎'; // Fix bi-directional text display defect in RTL languages. - $return .= '' . __('Edit') . "\n"; - $return .= '' . $post_name . "\n"; - if ( isset( $view_post ) ) { if( 'draft' == $post->post_status ) { $preview_link = set_url_scheme( get_permalink( $post->ID ) ); @@ -1258,7 +1233,16 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { } } - /** This filter is documented in wp-admin/includes/post.php */ + /** + * Filter the sample permalink HTML markup. + * + * @since 2.9.0 + * + * @param string $return Sample permalink HTML markup. + * @param int|WP_Post $id Post object or ID. + * @param string $new_title New sample permalink title. + * @param string $new_slug New sample permalink slug. + */ $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug ); return $return; diff --git a/wp-includes/version.php b/wp-includes/version.php index 552cac8cd2..f048c919fb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.0-alpha-20140701'; +$wp_version = '4.0-alpha-20140702'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.