
內容簡介
這個外掛會新增一對按鈕,讓訪客能夠透過上/下投票提供有關網站上頁面、文章或自訂文章類型的回饋。可以在 WordPress 管理員的各個文章清單上查看上/下投票統計資料,也可以透過儀表板小工具中的統計資料表格查看這些統計資料,這些統計資料可以以 CSV 格式文件匯出。
使用範例:
啟用外掛程式,並在 WordPress 管理員的設定選單下訪問「RC Post Rating」頁面以設定所需的設定。這個設定畫面允許您啟用/停用儀表板小工具、各種文章類型的管理員欄位,在您的頁面/文章/自訂文章類型內設定全域預設的上/下投票按鈕文字,以及全域預設的按鈕 CSS 類別。
有兩種方法可用於將按鈕新增到您的網站,一種是短碼(Shortcode),另一種是現代版區塊編輯器的區塊 (Block)。需要注意的是,最簡單的方法是在設定頁面中設置全域屬性,然後將短碼或區塊添加到頁面 / 文章 / 自訂文章內容中,全域預設會自動在各自的區塊中渲染出。不過,短碼(目前是區塊版)提供了一種覆蓋這些全域預設值的方法。 因此,如果需要設置特定頁面的替代上 / 下文字,可以在需要時逐頁進行設置。短碼屬性如下:
id - 預設為短碼所在頁面的 ID,因此通常不需要在短碼中特別設置這個屬性
classes - 預設為外掛程式設定頁面的全域值,如果未設置則為空
uptext - 預設為外掛程式設定頁面的全域值,如果未設置則為 "Up"
downtext - 預設為外掛程式設定頁面的全域值,如果未設置則為 "Down"
最基本的短碼格式為:
[rc_post_rating]
如果要覆蓋預設值之外的屬性,請使用以下格式:
[rc_post_rating classes="my-buttons" uptext="Yes" downtext="No"]
這將使用來自外掛程式設定頁面的預設設定。
外掛標籤
開發者團隊
原文外掛簡介
This plugin adds a pair of buttons that provide the ability for visitors to your website to give feedback on page / post / custom post type content by up / down rating. The Up/down rating statistics can be viewed on the respective post lists in the WordPress admin and also via a table of statistics in a Dashboard widget, these statistics can be exported in a CSV format file.
Example usage:
Enable the plugin and access the “RC Post Rating” page in the Settings menu in your WordPress Admin to configure the required settings. The settings screen allows you to enable/disable the Dashboard widget, admin columns for the various post types on your site, set the global default Up / Downvote button text and also global default CSS classes for the buttons.
There are two methods that can be used to add the buttons to your site, a shortcode and a block for the modern block editor. Note that the simplest way to use it is to set the global attributes in the settings page then add the shortcode or block to the page / post / cpt content, the global defaults will automatically be brought in to the rendered code from each of these blocks. Note however that the shortcode (unlike the block version at this time) does provide a way to override these defaults, so if alternatve Up / Down text was needed for a specific page then these can be set per page if needed. The shortcode attributes are as follows:
id – defaults to the ID of the page that the shortcode is on, so this doesn’t need to be specifically set in the shortcode so normally you would omit this attribute
classes – defaults to the global values from the plugin settings page, or empty if these haven’t been set
uptext – defaults to the global values from the plugin settings page, or ‘Up’ if these haven’t been set
downtext – defaults to the global values from the plugin settings page, or ‘Down’ if these haven’t been set
The most basic shortcode format is:
[rc_post_rating]
To override the default classes and button text you would use:
[rc_post_rating classes="my-buttons" uptext="Yes" downtext="No"]
This will use the default settings from the plugin’s admin page.
