
內容簡介
這個外掛會新增一個短代碼和功能,以便在文章中加入「刪除文章」的連結,使使用者可以刪除它們。預設情況下,要求使用者擁有欲刪除之文章的「delete_post」權限,但如果你想要混亂,可以將其自訂為「loggedin」或甚至是「public」。
短代碼
[sewn_post_delete_link] // 載入目前的文章以供編輯
[sewn_post_delete_link text="再見文章" before="" after="" title="" class=""] // 將連結文字更改為「再見文章」
屬性
這些屬性也是套用到下面的模板中。
text = 連結文字
before = 連結前要顯示的 HTML
after = 連結後要顯示的 HTML
title = 連結標題,預設為連結文字
class = 連結要新增的額外類別
模板中
這將會顯示連結,使使用者可以使用它。
do_action('sewn/post_delete/link');
do_action('sewn/post_delete/link', array('text'=>"再見文章", 'before'=>'', 'after'=>'', title=>'', 'class'=>''));
外掛標籤
開發者團隊
原文外掛簡介
Adds a shortcode and action to add a “Delete Post” link to posts so user’s can delete them. By default it requires the user to have the “delete_post” capability for the post in question, but if you want anarchy, you can customize that all the way to loggedin or even public…
SHORTCODE
[sewn_post_delete_link] // Loads current post for editing
[sewn_post_delete_link text="Bye bye post" before="" after="" title="" class=""] // Will change the link text to "Bye bye post"
Attributes
These are the same arguments for in template action below.
text = link text
before = html to show before the link
after = html to show after the link
title = the link title, defaults to link text
class = extra classes to add to the link
IN TEMPLATE
This will show the link to users have the ability to use it.
do_action('sewn/post_delete/link');
do_action('sewn/post_delete/link', array('text'=>"Bye bye post", 'before'=>'', 'after'=>'', title=>'', 'class'=>''));
