Title: B7 Random Number
Author: blogvii
Published: <strong>2024 年 11 月 3 日</strong>
Last modified: 2024 年 11 月 3 日

---

搜索插件

![](https://ps.w.org/b7-random-number/assets/banner-772x250.png?rev=3180730)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/b7-random-number/assets/icon-128x128.png?rev=3180730)

# B7 Random Number

 作者：[blogvii](https://profiles.wordpress.org/blogvii/)

[下载](https://downloads.wordpress.org/plugin/b7-random-number.1.0.0.zip)

 * [详情](https://cn.wordpress.org/plugins/b7-random-number/#description)
 * [评价](https://cn.wordpress.org/plugins/b7-random-number/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/b7-random-number/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/b7-random-number/#developers)

 [支持](https://wordpress.org/support/plugin/b7-random-number/)

## 描述

The B7 Random Number plugin allows you to easily generate random numbers directly
within your WordPress posts, pages, or widgets. With customizable parameters, you
can specify the range, format, and even the type of number (odd or even) you want
to display.

### Parameters

 * **min**: Specify the minimum value for the random number. Default is `1`.
 * **max**: Specify the maximum value for the random number. Default is `100`.
 * **count**: Define how many random numbers to generate. Default is `1`.
 * **type**: Set the type of number to generate. Use `even` for even numbers and`
   odd` for odd numbers.
 * **comma**: Control the formatting of the output. Set to `yes` to include commas
   in large numbers, or `no` to remove them. Default is `yes`.
 * **decimals**: Specify the number of decimal places for the generated number. 
   Default is `0`.
 * **prefix**: Add a prefix to the generated number. For example: `ID-`.
 * **suffix**: Add a suffix to the generated number. For example: `-XYZ`.

### Key Features

 * **Versatile Number Generation**: Generate random numbers between specified minimum
   and maximum values.
 * **Multiple Configurations**: Control the output with options for number formatting,
   decimal places, and inclusion of prefixes and suffixes.
 * **Type Control**: Choose to generate only odd or even numbers based on your requirements.

### Shortcode Examples

 * Basic usage: `[blogvii_rand_number]`
 * Specific range: `[blogvii_rand_number min=1 max=100]`
 * Generate multiple numbers: `[blogvii_rand_number count=5]`
 * Odd number only: `[blogvii_rand_number type=odd]`
 * With prefix: `[blogvii_rand_number prefix="ID-"]`

## 屏幕截图

 * [[
 * Example of using the shortcode [blogvii_random_number] with parameters..

## 安装

 1. Install and activate the plugin from your WordPress Admin Dashboard.
 2. Insert the shortcode into your content where you want the random number to appear.
 3. Customize the shortcode with parameters as needed to fit your use case.

## 常见问题

### 1. What is the B7 Random Number plugin?

The B7 Random Number plugin allows you to generate random numbers within your WordPress
posts, pages, or widgets using a simple shortcode. You can customize the range, 
formatting, and type of number generated.

### 2. How do I use the shortcode?

To use the shortcode, simply insert `[blogvii_random_number]` into your post or 
page. You can customize it with parameters like `min`, `max`, `count`, `type`, `
prefix`, and `suffix` to fit your needs.

### 3. Can I specify a range for the random numbers?

Yes! You can specify a minimum and maximum range using the `min` and `max` attributes.
For example: `[blogvii_random_number min=1 max=100]` will generate a random number
between 1 and 100.

### 4. Is it possible to generate multiple random numbers?

Absolutely! You can generate multiple random numbers by using the `count` attribute.
For example: `[blogvii_random_number count=5]` will generate five random numbers.

### 5. Can I generate only odd or even numbers?

Yes, you can specify the type of number you want to generate by using the `type`
attribute. Use `type=even` for even numbers and `type=odd` for odd numbers. For 
example: `[blogvii_random_number type=even]`.

### 6. How can I format the numbers?

You can control the formatting of the output using the `comma` and `decimals` attributes.
Set `comma=no` to remove commas, and specify the number of decimal places with the`
decimals` attribute, like so: `[blogvii_random_number decimals=2]`.

### 7. What happens if I set an invalid range?

If the minimum value is not less than the maximum value, the shortcode will return
an error message: “Invalid range: min must be less than max.”

### 8. Can I add a prefix or suffix to the generated number?

Yes, you can add a prefix or suffix by using the `prefix` and `suffix` attributes.
For example: `[blogvii_random_number prefix="ID-" suffix="-XYZ"]` will output something
like “ID-45-XYZ”.

### 9. Is this plugin secure?

Yes, the B7 Random Number plugin utilizes WordPress’s built-in functions for secure
random number generation and data sanitization, ensuring a secure experience.

## 评价

此插件暂无评价。

## 贡献者及开发者

「B7 Random Number」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ blogvii ](https://profiles.wordpress.org/blogvii/)

[帮助将「B7 Random Number」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/b7-random-number)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/b7-random-number/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/b7-random-number/)，或通过[RSS](https://plugins.trac.wordpress.org/log/b7-random-number/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/b7-random-number/)。

## 更新日志

#### 1.0.0 – Release Date 27th Oct 2024

Initial release.

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**2 年前**
 *  活跃安装数量 **70+**
 *  WordPress 版本 ** 5.9 或更高版本 **
 *  已测试的最高版本为 **6.6.5**
 *  PHP 版本 ** 7.2 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/b7-random-number/)
 * 标签
 * [number](https://cn.wordpress.org/plugins/tags/number/)[random](https://cn.wordpress.org/plugins/tags/random/)
   [random number](https://cn.wordpress.org/plugins/tags/random-number/)
 *  [高级视图](https://cn.wordpress.org/plugins/b7-random-number/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/b7-random-number/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/b7-random-number/reviews/)

## 贡献者

 *   [ blogvii ](https://profiles.wordpress.org/blogvii/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/b7-random-number/)