mirror of
https://github.com/julien731/WP-Review-Me.git
synced 2025-11-21 18:23:24 +08:00
6
Home
Julien Liabeuf edited this page 2016-04-20 08:40:38 +07:00
This wiki contains the documentation for WP Review Me. While the library is extremely simple to use, it has a few advanced options that need clarification. Also, this doc will detail how the various integrations work.
In its simplest form, the library only requires 2 parameters: the product type (plugin or theme) and the product slug.
The product slug must be exactly the same as is on WordPress.org.
In this example, I will create a review action for one of my plugins called Awesome Support.
The plugin slug on WordPress.org is awesome-support, so this is how I will instantiate the class:
new WP_Review_Me( array( 'type' => 'plugin', 'slug' => 'awesome-support' ) );
That's it. In 10 days (default value) after installation, the plugin will ask the user to leave a review.
The WRM_WordPress class, and most extended classes, take a few optional parameters. Here is the full list of available parameters (including the 2 above).
$args (array)
slug (string)(mandatory): product slug exactly like it is on WordPress.orgtype (string)(mandatory): type of product (either plugin or theme)days_after (int): number of days after installation to trigger the review actionrating (int): number of stars the user review should default to (default is 5 stars)message (string): the message to display in the admin notice to encourage the user to leave a reviewlink_label (string): label of the link that redirects the user to the review form on WordPress.orgcap (string): capability required for the notice to display (see WP Dismissible Notices Handler parameters)scope (string): scope of the notice dismissal (see WP Dismissible Notices Handler parameters)new WP_Review_Me( array(
'days_after' => 15,
'type' => 'plugin',
'slug' => 'awesome-support',
'rating' => 5,
'message' => 'Review me!',
'link_label' => 'Click here to review'
) );
Deleting the wiki page "Home" cannot be undone. Continue?
专为开源 Web 生态打造的企业级代码托管平台,深度支持 WordPress、Laravel、Vue.js、React 等主流技术栈,致力于推动中国开放网络 OpenWeb 发展,助力本土开源项目建设。