承接 shazzad/wp-admin-notice 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shazzad/wp-admin-notice

Composer 安装命令:

composer require shazzad/wp-admin-notice

包简介

Library to add & display admin notices in WordPress

README 文档

README

Helper class to display admin notices.

Installation

composer require shazzad/wp-admin-notice

Initialization

Initialize the service provider.

\Shazzad\WpAdminNotice\Provider::setup();

Adding notice.

Call the function do_action with appropriate parameter to add a notice. This code must be placed before wp admin area start rendering content on screen. Use admin_notices, all_admin_notices or network_admin_notices action hook to add notice.

do_action(
	'swpan_notice',
	array(
		'success' => __('You setting is stored successfully.'),
		'id'      => 'plugin-setting',
	)
);

do_action(
	'swpan_notice',
	array(
		'error' => __('Sorry, we could not save your settings.'),
	)
);

Adding user notice.

Use user notice when you perform some action and redirect the user to a page. The notice will be stored for until it is displayed to the user. Add a third parameter to the action hook to add a user notice.

do_action(
	'swpan_notice',
	array(
		'message' => __('You setting is stored successfully.'),
		'type'    => 'success',
		'id'      => 'my-notice-id',
	),
	'user'
);

do_action(
	'swpan_notice',
	array(
		'message' => __('Sorry, we could not save your settings.'),
		'type'    => 'error',
		'id'      => 'my-notice-id',
	),
	'user'
);

Requirements

  • WordPress: 6.0.1
  • PHP: 7.4
  • Tested: 6.2.2

统计信息

  • 总下载量: 762
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2023-07-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固