Changeset 53715 for trunk/src/wp-admin/includes/post.php
- Timestamp:
- 07/18/2022 05:35:51 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r53559 r53715 1377 1377 * @since 2.5.0 1378 1378 * 1379 * @param int|WP_Post $ idPost ID or post object.1379 * @param int|WP_Post $post Post ID or post object. 1380 1380 * @param string|null $title Optional. Title to override the post's current title 1381 1381 * when generating the post name. Default null. … … 1388 1388 * } 1389 1389 */ 1390 function get_sample_permalink( $id, $title = null, $name = null ) { 1391 $post = get_post( $id ); 1390 function get_sample_permalink( $post, $title = null, $name = null ) { 1391 $post = get_post( $post ); 1392 1392 1393 if ( ! $post ) { 1393 1394 return array( '', '' ); … … 1469 1470 * @since 2.5.0 1470 1471 * 1471 * @param int|WP_Post $ idPost ID or post object.1472 * @param int|WP_Post $post Post ID or post object. 1472 1473 * @param string|null $new_title Optional. New title. Default null. 1473 1474 * @param string|null $new_slug Optional. New slug. Default null. 1474 1475 * @return string The HTML of the sample permalink slug editor. 1475 1476 */ 1476 function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { 1477 $post = get_post( $id ); 1477 function get_sample_permalink_html( $post, $new_title = null, $new_slug = null ) { 1478 $post = get_post( $post ); 1479 1478 1480 if ( ! $post ) { 1479 1481 return ''; … … 1512 1514 // Encourage a pretty permalink setting. 1513 1515 if ( ! get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) 1514 && ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $ id)1516 && ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) 1515 1517 ) { 1516 1518 $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small">' . __( 'Change Permalink Structure' ) . "</a></span>\n"; … … 1629 1631 * @since 2.5.0 1630 1632 * 1631 * @param int|WP_Post $post _idID or object of the post to check for editing.1633 * @param int|WP_Post $post ID or object of the post to check for editing. 1632 1634 * @return int|false ID of the user with lock. False if the post does not exist, post is not locked, 1633 1635 * the user with lock does not exist, or the post is locked by current user. 1634 1636 */ 1635 function wp_check_post_lock( $post_id ) { 1636 $post = get_post( $post_id ); 1637 function wp_check_post_lock( $post ) { 1638 $post = get_post( $post ); 1639 1637 1640 if ( ! $post ) { 1638 1641 return false; … … 1640 1643 1641 1644 $lock = get_post_meta( $post->ID, '_edit_lock', true ); 1645 1642 1646 if ( ! $lock ) { 1643 1647 return false; … … 1667 1671 * @since 2.5.0 1668 1672 * 1669 * @param int|WP_Post $post _idID or object of the post being edited.1673 * @param int|WP_Post $post ID or object of the post being edited. 1670 1674 * @return array|false { 1671 1675 * Array of the lock time and user ID. False if the post does not exist, or there … … 1676 1680 * } 1677 1681 */ 1678 function wp_set_post_lock( $post_id ) { 1679 $post = get_post( $post_id ); 1682 function wp_set_post_lock( $post ) { 1683 $post = get_post( $post ); 1684 1680 1685 if ( ! $post ) { 1681 1686 return false; … … 1683 1688 1684 1689 $user_id = get_current_user_id(); 1690 1685 1691 if ( 0 == $user_id ) { 1686 1692 return false; … … 1702 1708 function _admin_notice_post_locked() { 1703 1709 $post = get_post(); 1710 1704 1711 if ( ! $post ) { 1705 1712 return; … … 1708 1715 $user = null; 1709 1716 $user_id = wp_check_post_lock( $post->ID ); 1717 1710 1718 if ( $user_id ) { 1711 1719 $user = get_userdata( $user_id ); … … 1937 1945 1938 1946 $post = get_post( $post_ID ); 1947 1939 1948 if ( ! $post ) { 1940 1949 wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
Note: See TracChangeset
for help on using the changeset viewer.