开发者 |
ndiego
outermostdesign |
---|---|
更新时间 | 2024年11月9日 02:14 |
PHP版本: | 8.0 及以上 |
WordPress版本: | 6.7 |
版权: | GPL-2.0-or-later |
版权网址: | 版权信息 |
Search for "Plugin Stat" in the block inserter and add it to a post just like you would any other block. In the inspector, enter the plugin slug and choose the stat you wish to display.
The slug can be retrieved from the plugin's URL on WordPress.org. For example, this plugin's slug is easy-plugin-stats
.
Insert a WordPress Buttons block, then click on the +
inserter or open the block inserter. Besides the default Button block, you'll see the Plugin Button variation. Insert the Plugin Button into the Buttons block. In the inspector, enter the plugin slug and choose the link you wish to connect to the button.
The slug can be retrieved from the plugin's URL on WordPress.org. For example, this plugin's slug is easy-plugin-stats
.
Below is the base shortcode structure with defaults. Technically, slug
is the only required field. If you enter your plugin's slug and place the shortcode in a post or template, it will display the number of active installs and cache the data for 43200
seconds (12 hours).
[eps type="single" slug="your-plugin-slug" field="active_installs" cache="43200" before="" after=""]
type
Optional. The type of stat you with to display, either a stat from a single plugin or an aggregate stat generated from multiple plugins. Accepts single
or aggregate
. Defaults to single
.
slug
Required. This is the slug which can be retrieved from the plugin's URL on WordPress.org. For example, this plugin's slug is easy-plugin-stats
. Accepts any valid plugin slug for single
, or any number of space-separated plugin slugs when using aggregate
. Defaults to null
.
field
Optional. The name of the field you have chosen to display. Accepts any of the following fields. Defaults to active_installs
.
The available stat fields for single
are:
active_installs
– Active installsdownloaded
– Times downloadedname
– Plugin Nameslug
– Plugin Slugversion
– Versionauthor
– Authorcontributors
– Contributorstags
– Tagsrequires
– Requirestested
– Testednum_ratings
– Number of reviewsrating
– Rating out of 100five_rating
– Rating out of 5star_rating
– Star ratinglast_updated
– Last updatedadded
– Date addedhomepage_link
– Plugin homepage linkdownload_link
– Download linklive_preview_link
– Live preview linksupport_link
– Support forum linkreviews_link
– Reviews linkauthor_profile
– Author profile linkdonate_link
– Donate linkdescription
– Descriptioninstallation
– Installationscreenshots
– Screenshotschangelog
– Changelogfaq
– FAQaggregate
are:
active_installs
– Active installsdownloaded
– Times downloaded5
. Defaults to 43200
(i.e. 12 hours).
before
Optional. Optional HTML to be printed before the field's output. Accepts any valid HTML, but note that all double quotes will be replaced with single quotes to adhere to the required shortcode markup. Defaults to null
.
after
Optional. Optional HTML to be printed after the field's output. Accepts any valid HTML, but note that all double quotes will be replaced with single quotes to adhere to the required shortcode markup. Defaults to null
.
eps
shortcode generated a critical error on the front end.