Changeset 37258
- Timestamp:
- 04/20/2016 02:36:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r37254 r37258 2612 2612 * @global WP_Rewrite $wp_rewrite 2613 2613 * 2614 * @param int $pagenum Optional. Page number. 2615 * @param int $max_page Optional. The maximum number of comment pages. 2614 * @param int $pagenum Optional. Page number. Default 1. 2615 * @param int $max_page Optional. The maximum number of comment pages. Default 0. 2616 2616 * @return string The comments page number link URL. 2617 2617 */ … … 2656 2656 * @global WP_Query $wp_query 2657 2657 * 2658 * @param string $label Optional. Label for link text. 2659 * @param int $max_page Optional. Max page. 2658 * @param string $label Optional. Label for link text. Default empty. 2659 * @param int $max_page Optional. Max page. Default 0. 2660 2660 * @return string|void HTML-formatted link for the next page of comments. 2661 2661 */ … … 2701 2701 * @since 2.7.0 2702 2702 * 2703 * @param string $label Optional. Label for link text. 2704 * @param int $max_page Optional. Max page. 2703 * @param string $label Optional. Label for link text. Default empty. 2704 * @param int $max_page Optional. Max page. Default 0. 2705 2705 */ 2706 2706 function next_comments_link( $label = '', $max_page = 0 ) { … … 2713 2713 * @since 2.7.1 2714 2714 * 2715 * @param string $label Optional. Label for comments link text. 2715 * @param string $label Optional. Label for comments link text. Default empty. 2716 2716 * @return string|void HTML-formatted link for the previous page of comments. 2717 2717 */ … … 2745 2745 * @since 2.7.0 2746 2746 * 2747 * @param string $label Optional. Label for comments link text. 2747 * @param string $label Optional. Label for comments link text. Default empty. 2748 2748 */ 2749 2749 function previous_comments_link( $label = '' ) { … … 2759 2759 * @global WP_Rewrite $wp_rewrite 2760 2760 * 2761 * @param string|array $args Optional args. See paginate_links(). 2761 * @param string|array $args Optional args. See paginate_links(). Default empty array. 2762 2762 * @return string|void Markup for pagination links. 2763 2763 */ 2764 function paginate_comments_links( $args = array()) {2764 function paginate_comments_links( $args = array() ) { 2765 2765 global $wp_rewrite; 2766 2766 … … 2800 2800 * Optional. Default comments navigation arguments. 2801 2801 * 2802 * @type string $prev_text Anchor text to display in the previous comments link. Default 'Older comments'. 2803 * @type string $next_text Anchor text to display in the next comments link. Default 'Newer comments'. 2802 * @type string $prev_text Anchor text to display in the previous comments link. 2803 * Default 'Older comments'. 2804 * @type string $next_text Anchor text to display in the next comments link. 2805 * Default 'Newer comments'. 2804 2806 * @type string $screen_reader_text Screen reader text for nav element. Default 'Comments navigation'. 2805 2807 * } … … 2839 2841 * @since 4.4.0 2840 2842 * 2841 * @param array $args See {@see get_the_comments_navigation()} for available arguments.2843 * @param array $args See get_the_comments_navigation() for available arguments. Default empty array. 2842 2844 */ 2843 2845 function the_comments_navigation( $args = array() ) { … … 2883 2885 * @since 4.4.0 2884 2886 * 2885 * @param array $args See {@see get_the_comments_pagination()} for available arguments.2887 * @param array $args See get_the_comments_pagination() for available arguments. Default empty array. 2886 2888 */ 2887 2889 function the_comments_pagination( $args = array() ) { … … 2893 2895 * 2894 2896 * @since 2.6.0 2897 * 2898 * @global bool $is_IE Whether the browser matches an Internet Explorer user agent. 2899 * @global string $wp_version WP version. 2895 2900 * 2896 2901 * @global bool $is_IE … … 3034 3039 * @since 3.0.0 3035 3040 * 3036 * @param string $path Optional. Path relative to the site url. 3041 * @param string $path Optional. Path relative to the site url. Default empty. 3037 3042 * @param string $scheme Optional. Scheme to give the site url context. See set_url_scheme(). 3038 3043 * @return string Site url link with optional path appended. … … 3093 3098 * 3094 3099 * @param string $path Optional path relative to the admin url. 3095 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3100 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 3101 * 'http' or 'https' can be passed to force those schemes. 3096 3102 * @return string Admin url link with optional path appended. 3097 3103 */ … … 3109 3115 * @param string $scheme Optional. The scheme to use. Accepts 'http' or 'https', 3110 3116 * to force those schemes. Default 'admin', which obeys 3111 * {@see force_ssl_admin()} and {@see is_ssl()}.3117 * force_ssl_admin() and is_ssl(). 3112 3118 * @return string Admin url link with optional path appended. 3113 3119 */ … … 3135 3141 * @since 2.6.0 3136 3142 * 3137 * @param string $path Optional. Path relative to the includes url. 3138 * @param string $scheme Optional. Scheme to give the includes url context. 3143 * @param string $path Optional. Path relative to the includes url. Default empty. 3144 * @param string $scheme Optional. Scheme to give the includes url context. Accepts 3145 * 'http', 'https', or 'relative'. Default null. 3139 3146 * @return string Includes url link with optional path appended. 3140 3147 */ … … 3162 3169 * @since 2.6.0 3163 3170 * 3164 * @param string $path Optional. Path relative to the content url. 3171 * @param string $path Optional. Path relative to the content url. Default empty. 3165 3172 * @return string Content url link with optional path appended. 3166 3173 */ 3167 function content_url( $path = '') {3174 function content_url( $path = '' ) { 3168 3175 $url = set_url_scheme( WP_CONTENT_URL ); 3169 3176 … … 3243 3250 * @since 3.0.0 3244 3251 * 3245 * @param string $path Optional. Path relative to the site url. 3246 * @param string $scheme Optional. Scheme to give the site url context. See set_url_scheme(). 3252 * @see set_url_scheme() 3253 * 3254 * @param string $path Optional. Path relative to the site url. Default empty. 3255 * @param string $scheme Optional. Scheme to give the site url context. Accepts 3256 * 'http', 'https', or 'relative'. Default null. 3247 3257 * @return string Site url link with optional path appended. 3248 3258 */ … … 3278 3288 * Retrieves the home URL for the current network. 3279 3289 * 3280 * Returns the home url with the appropriate protocol, 'https' {@see is_ssl()}3290 * Returns the home url with the appropriate protocol, 'https' is_ssl() 3281 3291 * and 'http' otherwise. If `$scheme` is 'http' or 'https', `is_ssl()` is 3282 3292 * overridden. … … 3326 3336 * @since 3.0.0 3327 3337 * 3328 * @param string $path Optional path relative to the admin url. 3329 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3338 * @param string $path Optional path relative to the admin url. Default empty. 3339 * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() 3340 * and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3330 3341 * @return string Admin url link with optional path appended. 3331 3342 */ … … 3356 3367 * @since 3.0.0 3357 3368 * 3358 * @param string $path Optional path relative to the admin url. 3359 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3369 * @param string $path Optional. Path relative to the admin url. Default empty. 3370 * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() 3371 * and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3360 3372 * @return string Admin url link with optional path appended. 3361 3373 */ … … 3383 3395 * @since 3.1.0 3384 3396 * 3385 * @param string $path Optional path relative to the admin url. 3386 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3397 * @param string $path Optional. Path relative to the admin url. Default empty. 3398 * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() 3399 * and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3387 3400 * @return string Admin url link with optional path appended. 3388 3401 */ 3389 function self_admin_url( $path = '', $scheme = 'admin') {3402 function self_admin_url( $path = '', $scheme = 'admin' ) { 3390 3403 if ( is_network_admin() ) 3391 3404 return network_admin_url($path, $scheme); … … 3446 3459 * Retrieves the URL to the user's dashboard. 3447 3460 * 3448 * If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site,3449 * the dashboard for the current site is returned. If the user cannot edit the current site, the dashboard to the user's3450 * primary site is returned.3461 * If a user does not belong to any site, the global user dashboard is used. If the user 3462 * belongs to the current site, the dashboard for the current site is returned. If the user 3463 * cannot edit the current site, the dashboard to the user's primary site is returned. 3451 3464 * 3452 3465 * @since 3.1.0 3453 3466 * 3454 3467 * @param int $user_id Optional. User ID. Defaults to current user. 3455 * @param string $path Optional path relative to the dashboard. Use only paths known to both site and user admins. 3456 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3468 * @param string $path Optional path relative to the dashboard. Use only paths known to 3469 * both site and user admins. Default empty. 3470 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() 3471 * and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3457 3472 * @return string Dashboard url link with optional path appended. 3458 3473 */ … … 3498 3513 * 3499 3514 * @param int $user_id Optional. User ID. Defaults to current user. 3500 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().3501 * 'http' or 'https' can be passed to force those schemes.3515 * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() 3516 * and is_ssl(). 'http' or 'https' can be passed to force those schemes. 3502 3517 * @return string Dashboard url link with optional path appended. 3503 3518 */ … … 3560 3575 * Returns a shortlink for a post, page, attachment, or site. 3561 3576 * 3562 * This function exists to provide a shortlink tag that all themes and plugins can target. A plugin must hook in to3563 * provide the actual shortlinks. Default shortlink support is limited to providing ?p= style links for posts.3564 * Plugins can short-circuit this function via the pre_get_shortlink filter or filter the output3565 * via the get_shortlinkfilter.3577 * This function exists to provide a shortlink tag that all themes and plugins can target. 3578 * A plugin must hook in to provide the actual shortlinks. Default shortlink support is 3579 * limited to providing ?p= style links for posts. Plugins can short-circuit this function 3580 * via the {@see 'pre_get_shortlink'} filter or filter the output via the {@see 'get_shortlink'} filter. 3566 3581 * 3567 3582 * @since 3.0.0. 3568 3583 * 3569 * @param int $id A post or site id. Default is 0, which means the current post or site. 3570 * @param string $context Whether the id is a 'site' id, 'post' id, or 'media' id. 3571 * If 'post', the post_type of the post is consulted. 3572 * If 'query', the current query is consulted to determine the id and context. 3573 * Default is 'post'. 3574 * @param bool $allow_slugs Whether to allow post slugs in the shortlink. It is up to the plugin how and whether to honor this. 3575 * @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks are not enabled. 3576 */ 3577 function wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) { 3584 * @param int $id Optional. A post or site id. Default is 0, which means the current post or site. 3585 * @param string $context Optional. Whether the id is a 'site' id, 'post' id, or 'media' id. If 'post', 3586 * the post_type of the post is consulted. If 'query', the current query is consulted 3587 * to determine the id and context. Default 'post'. 3588 * @param bool $allow_slugs Optional. Whether to allow post slugs in the shortlink. It is up to the plugin how 3589 * and whether to honor this. Default true. 3590 * @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks 3591 * are not enabled. 3592 */ 3593 function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) { 3578 3594 /** 3579 3595 * Filters whether to preempt generating a shortlink for the given post. … … 3634 3650 * Injects rel=shortlink into the head if a shortlink is defined for the current page. 3635 3651 * 3636 * Attached to the wp_headaction.3652 * Attached to the {@see 'wp_head'} action. 3637 3653 * 3638 3654 * @since 3.0.0 … … 3671 3687 * Must be called from inside "The Loop" 3672 3688 * 3673 * Call like the_shortlink( __('Shortlinkage FTW'))3689 * Call like the_shortlink( __( 'Shortlinkage FTW' ) ) 3674 3690 * 3675 3691 * @since 3.0.0 … … 3677 3693 * @param string $text Optional The link text or HTML to be displayed. Defaults to 'This is the short link.' 3678 3694 * @param string $title Optional The tooltip for the link. Must be sanitized. Defaults to the sanitized post title. 3679 * @param string $before Optional HTML to display before the link. 3680 * @param string $after Optional HTML to display after the link. 3695 * @param string $before Optional HTML to display before the link. Default empty. 3696 * @param string $after Optional HTML to display after the link. Default empty. 3681 3697 */ 3682 3698 function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {
Note: See TracChangeset
for help on using the changeset viewer.