diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php
index 510d9a1..e092e1e 100644
a
|
b
|
function get_permalink( $post = 0, $leavename = false ) { |
165 | 165 | */ |
166 | 166 | $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename ); |
167 | 167 | |
168 | | if ( '' != $permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) { |
| 168 | /** |
| 169 | * Filters the list of post statuses which should use shortlinks and avoid fancy permalinks. |
| 170 | * |
| 171 | * @since 4.3.0 |
| 172 | * |
| 173 | * @param array $statuses The list of statuses |
| 174 | */ |
| 175 | $auto_short_link_statuses = apply_filters( 'shortlink_post_statuses', array( |
| 176 | 'draft', |
| 177 | 'pending', |
| 178 | 'auto-draft', |
| 179 | 'future' |
| 180 | ) ); |
| 181 | |
| 182 | if ( '' != $permalink && ! in_array( $post->post_status, $auto_short_link_statuses ) ) { |
169 | 183 | $unixtime = strtotime( $post->post_date ); |
170 | 184 | |
171 | 185 | $category = ''; |
… |
… |
function get_post_permalink( $id = 0, $leavename = false, $sample = false ) { |
272 | 286 | |
273 | 287 | $slug = $post->post_name; |
274 | 288 | |
275 | | $draft_or_pending = get_post_status( $post ) && in_array( get_post_status( $post ), array( 'draft', 'pending', 'auto-draft', 'future' ) ); |
| 289 | $auto_short_link_statuses = apply_filters( 'shortlink_post_statuses', array( |
| 290 | 'draft', |
| 291 | 'pending', |
| 292 | 'auto-draft', |
| 293 | 'future' |
| 294 | ) ); |
| 295 | $draft_or_pending = get_post_status( $post ) && in_array( get_post_status( $post ), $auto_short_link_statuses ); |
276 | 296 | |
277 | 297 | $post_type = get_post_type_object( $post->post_type ); |
278 | 298 | |
… |
… |
function _get_page_link( $post = false, $leavename = false, $sample = false ) { |
368 | 388 | |
369 | 389 | $post = get_post( $post ); |
370 | 390 | |
371 | | $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) ); |
| 391 | $auto_short_link_statuses = apply_filters( 'shortlink_post_statuses', array( |
| 392 | 'draft', |
| 393 | 'pending', |
| 394 | 'auto-draft', |
| 395 | 'future' |
| 396 | ) ); |
| 397 | |
| 398 | $draft_or_pending = get_post_status( $post ) && in_array( get_post_status( $post ), $auto_short_link_statuses ); |
372 | 399 | |
373 | 400 | $link = $wp_rewrite->get_page_permastruct(); |
374 | 401 | |