# Astra Notices
Easily Create Admin Notices.
### How to use this library
1. Download the latest release from the tag as shown in the screenshot.
![Download Package](https://cl.ly/f50cb1a45894/Image%2525202019-02-26%252520at%25252011.51.12%252520AM.png)
2. Require the file `class-astra-notices.php` in your project.
3. Register your notices on action `admin_notices` by calling method `Astra_Notices::add_notice()`
**Default Parameters**
```PHP
array(
'id' => '', // Optional, Notice ID. If empty it set `astra-notices-id-<$array-index>`.
'type' => 'info', // Optional, Notice type. Default `info`. Expected [info, warning, notice, error].
'message' => '', // Optional, Message.
'show_if' => true, // Optional, Show notice on custom condition. E.g. 'show_if' => if( is_admin() ) ? true, false, .
'repeat-notice-after' => '', // Optional, Dismiss-able notice time. It'll auto show after given time.
'display-notice-after' => false, // Optional, Dismiss-able notice time. It'll auto show after given time.
'class' => '', // Optional, Additional notice wrapper class.
'priority' => 10, // Priority of the notice.
'display-with-other-notices' => true, // Should the notice be displayed if other notices are being displayed from Astra_Notices.
)
```
**Example Usage**
```PHP
add_action(
'admin_notices',
function() {
Astra_Notices::add_notice(
array(
'id' => 'your-notice-id',
'type' => '',
'message' => sprintf(
'<div class="notice-image">
<img src="%1$s" class="custom-logo" alt="Sidebar Manager" itemprop="logo"></div>
<div class="notice-content">
<div class="notice-heading">
%2$s
</div>
%3$s<br />
<div class="astra-review-notice-container">
<a href="%4$s" class="astra-notice-close astra-review-notice button-primary" target="_blank">
%5$s
</a>
<span class="dashicons dashicons-calendar"></span>
<a href="#" data-repeat-notice-after="%6$s" class="astra-notice-close astra-review-notice">
%7$s
</a>
<span class="dashicons dashicons-smiley"></span>
<a href="#" class="astra-notice-close astra-review-notice">
%8$s
</a>
</div>
</div>',
$image_path,
__( 'Hello! Seems like you have used Header Footer Elementor to build this website — Thanks a ton!', 'header-footer-elementor' ),
__( 'Could you please do us a BIG favor and give it a 5-star rating on WordPress? This would boost our motivation and help other users make a comfortable decision while choosing the Header Footer Elementor.', 'header-footer-elementor' ),
'https://wordpress.org/support/plugin/header-footer-elementor/reviews/?filter=5#new-post',
__( 'Ok, you deserve it', 'header-footer-elementor' ),
MONTH_IN_SECONDS,
__( 'Nope, maybe later', 'header-footer-elementor' ),
__( 'I already did', 'header-footer-elementor' )
),
'repeat-notice-after' => MONTH_IN_SECONDS,
'display-notice-after' => 1296000, // Display notice after 15 days.
'priority' => 18,
'display-with-other-notices' => false,
)
);
}
);
```
Also check the example of [how this is used](https://github.com/brainstormforce/astra/blob/b9038d6ea02ae04b27db23b789b66b60907b4c16/inc/core/class-astra-admin-settings.php#L148-L187) in the Astra Theme.
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v2.7.4.zip
共82个文件
php:21个
css:12个
js:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 71 浏览量
2022-04-12
14:34:23
上传
评论
收藏 509KB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v2.7.4 Multipurpose Before After Slider 滑块之后的多用途" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v2.7.4.zip (82个子文件)
baslider
css
images
controls.png 3KB
arrow.png 3KB
bx_loader.gif 723B
admin_rtl.css 5KB
admin.css 9KB
style-rtl.css 8KB
style.css 8KB
composer.json 372B
index.php 39KB
admin
bsf-core
composer.json 389B
index.php 30KB
plugin-installer
index.php 17KB
admin-functions.php 9KB
bsf.yml 65B
composer.lock 14KB
phpcs.xml.dist 712B
class-bsf-wp-cli-command.php 3KB
changelog.txt 892B
version.yml 8B
assets
css
frosty.css 4KB
switch.css 4KB
license-form-popup.css 3KB
style.css 38KB
images
existing-user.png 15KB
user-register.png 15KB
egg-shell.png 25KB
fonts
brainstorm.svg 2KB
brainstorm.eot 2KB
brainstorm.woff 2KB
brainstorm.ttf 2KB
js
bsf-core.js 1KB
jquery-history.js 15KB
license-form-popup.js 4KB
frosty.js 10KB
switch.js 555B
class-bsf-update-manager.php 21KB
class-bsf-license-manager.php 34KB
classes
class-bsf-core-update.php 1KB
class-bsf-envato-activate.php 16KB
auto-update
admin-functions.php 13KB
updater.php 8KB
includes
system-info.php 8KB
helpers.php 10KB
bsf.yml 12B
bsf-analytics
assets
css
minified
style-rtl.min.css 284B
style.min.css 284B
unminified
style-rtl.css 369B
style.css 369B
class-bsf-analytics.php 14KB
class-bsf-analytics-stats.php 7KB
icon-32@2x.png 5KB
images
set-1-after.jpg 70KB
01.png 13KB
set-2-before.jpg 29KB
02.png 21KB
load.gif 5KB
setting.png 4KB
set-2-after.jpg 33KB
set-1-before.jpg 69KB
config.php 1KB
phpcs.xml.dist 1KB
Changelog.txt 3KB
add-slider.php 6KB
class-baslider-widget.php 5KB
js
cp-script.min.js 3KB
jquery.form.js 49KB
jquery.baslider.min.js 19KB
jquery.baslider.js 50KB
jquery.media.upload.js 3KB
baslider_event.js 904B
package-lock.json 48KB
icon-32.png 4KB
languages
baslider.pot 16KB
README 0B
slider-settings.php 17KB
add-image-set.php 14KB
lib
notices
composer.json 350B
README.MD 4KB
notices.js 2KB
class-astra-notices.php 10KB
README.md 0B
icon-16.png 3KB
共 82 条
- 1
资源评论
Lee达森
- 粉丝: 1518
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Java 多线程课程的代码及少量注释.zip
- 数据库课程设计-基于的个性化购物平台的建表语句.sql
- 数据库课程设计-基于的图书智能一体化管理系统的建表语句.sql
- Java 代码覆盖率库.zip
- Java 代码和算法的存储库 也为该存储库加注星标 .zip
- 免安装Windows10/Windows11系统截图工具,无需安装第三方截图工具 双击直接使用截图即可 是一款免费可靠的截图小工具哦~
- Libero Soc v11.9的安装以及证书的获取(2021新版).zip
- BouncyCastle.Cryptography.dll
- 5.1 孤立奇点(JD).ppt
- 基于51单片机的智能交通灯控制系统的设计与实现源码+报告(高分项目)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功