Changeset 40975
- Timestamp:
- 07/01/2017 03:28:11 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r40931 r40975 248 248 * @global WP_Rewrite $wp_rewrite 249 249 * 250 * @param int $id Optional. Post ID. Default uses the global `$post`.251 * @param bool $leavename Optional, defaults to false. Whether to keep post name. Default false.252 * @param bool $sample Optional, defaults to false. Is it a sample permalink. Default false.250 * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. 251 * @param bool $leavename Optional, defaults to false. Whether to keep post name. Default false. 252 * @param bool $sample Optional, defaults to false. Is it a sample permalink. Default false. 253 253 * @return string|WP_Error The post permalink. 254 254 */ … … 265 265 $slug = $post->post_name; 266 266 267 $draft_or_pending = get_post_status( $ id ) && in_array( get_post_status( $id), array( 'draft', 'pending', 'auto-draft', 'future' ) );267 $draft_or_pending = get_post_status( $post ) && in_array( get_post_status( $post ), array( 'draft', 'pending', 'auto-draft', 'future' ) ); 268 268 269 269 $post_type = get_post_type_object($post->post_type); 270 270 271 271 if ( $post_type->hierarchical ) { 272 $slug = get_page_uri( $ id);272 $slug = get_page_uri( $post ); 273 273 } 274 274 … … 1263 1263 * @since 2.3.0 1264 1264 * 1265 * @param int $id Optional. Post ID. Default is the ID ofthe global `$post`.1266 * @param string $context Optional. How to output the '&' character. Default '&'.1265 * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. 1266 * @param string $context Optional. How to output the '&' character. Default '&'. 1267 1267 * @return string|null The edit post link for the given post. null if the post type is invalid or does 1268 1268 * not allow an editing UI. … … 1311 1311 * @since 4.4.0 The `$class` argument was added. 1312 1312 * 1313 * @param string $text Optional. Anchor text. If null, default is 'Edit This'. Default null.1314 * @param string $before Optional. Display before edit link. Default empty.1315 * @param string $after Optional. Display after edit link. Default empty.1316 * @param int $id Optional. Post ID. Default is the ID ofthe global `$post`.1317 * @param string $class Optional. Add custom class to link. Default 'post-edit-link'.1313 * @param string $text Optional. Anchor text. If null, default is 'Edit This'. Default null. 1314 * @param string $before Optional. Display before edit link. Default empty. 1315 * @param string $after Optional. Display after edit link. Default empty. 1316 * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. 1317 * @param string $class Optional. Add custom class to link. Default 'post-edit-link'. 1318 1318 */ 1319 1319 function edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) { … … 1351 1351 * @since 2.9.0 1352 1352 * 1353 * @param int $id Optional. Post ID. Default is the ID ofthe global `$post`.1354 * @param string $deprecated Not used.1355 * @param bool $force_delete Optional. Whether to bypass trash and force deletion. Default false.1353 * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. 1354 * @param string $deprecated Not used. 1355 * @param bool $force_delete Optional. Whether to bypass trash and force deletion. Default false. 1356 1356 * @return string|void The delete post link URL for the given post. 1357 1357 */
Note: See TracChangeset
for help on using the changeset viewer.