get_shortlink

過濾鉤子
apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs )
引數
  • (string) $shortlink Shortlink URL.
    Required:
  • (int) $id Post ID, or 0 for the current post.
    Required:
  • (string) $context The context for the link. One of 'post' or 'query',
    Required:
  • (bool) $allow_slugs Whether to allow post slugs in the shortlink. Not used by default.
    Required:
定義位置
相關勾子
pre_get_shortlinkthe_shortlinkget_comment_linkauthor_linkget_comments_link
相關方法
wp_get_shortlinkget_shortcut_linkthe_shortlinkget_author_linkget_linkget_month_link
引入
3.0.0
棄用
-

get_shortlink是一個WordPress函式,用於檢索一個文章或頁面的短連結URL: 該函式接受一個文章ID作為引數,並返回該文章或頁面的短連結URL。

過濾文章的短連結。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );
return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );
return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );

常見問題

FAQs
檢視更多 >