Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • bugfix/get_current_screen_fail
  • bugfix/notice-not-show
  • bugfix/wordpress-review
  • devel
  • feature/dismiss-nonce
  • fix/duplicate
  • master
  • replace-dodgy-path
  • 1.0
  • 1.0.1
  • 1.0.2
  • 2.0
  • 2.0.1
  • 2.1
  • 2.1.1
  • 2.2
  • 2.2.1
  • 2.2.2
  • 2.3
  • 3.0
  • 3.1
  • 3.1.1
  • 3.1.3
  • 3.1.4
  • 3.1.4-beta1
  • 3.2.0
  • 3.2.0-beta1
  • 3.2.0-beta2
  • 3.2.0-beta3
  • 3.2.0-beta4
  • 3.2.0-beta5
  • 3.2.0-beta6
  • 3.2.0-beta7
  • 3.2.1
  • 3.2.2
  • 3.2.3
  • 3.2.4
  • 3.2.5
  • 3.3.0
39 results

Target

Select target project
  • wpdesk/wp-notice
1 result
Select Git revision
  • bugfix/get_current_screen_fail
  • bugfix/notice-not-show
  • bugfix/wordpress-review
  • devel
  • feature/dismiss-nonce
  • fix/duplicate
  • master
  • replace-dodgy-path
  • 1.0
  • 1.0.1
  • 1.0.2
  • 2.0
  • 2.0.1
  • 2.1
  • 2.1.1
  • 2.2
  • 2.2.1
  • 2.2.2
  • 2.3
  • 3.0
  • 3.1
  • 3.1.1
  • 3.1.3
  • 3.1.4
  • 3.1.4-beta1
  • 3.2.0
  • 3.2.0-beta1
  • 3.2.0-beta2
  • 3.2.0-beta3
  • 3.2.0-beta4
  • 3.2.0-beta5
  • 3.2.0-beta6
  • 3.2.0-beta7
  • 3.2.1
  • 3.2.2
  • 3.2.3
  • 3.2.4
  • 3.2.5
  • 3.3.0
39 results
Show changes
Commits on Source (2)
......@@ -18,7 +18,7 @@ It also handles dismiss functionality with AJAX requests.
PHP 5.5 or later.
## Composer
## Installation with composer
You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
......@@ -32,7 +32,7 @@ To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-ba
require_once 'vendor/autoload.php';
```
## Manual instalation
## Manual installation
If you do not wish to use Composer, you can [download the latest release](https://gitlab.com/wpdesk/wp-notice/-/jobs/artifacts/master/download?job=library). Then, to use the Notices, include the init.php file.
......@@ -42,7 +42,7 @@ require_once('/path/to/wp-desk/wp-notice/init.php');
## Getting Started
Simple usage looks like:
### Simple usage looks like
```php
$notice = wpdesk_wp_notice('Notice text goes here');
......@@ -59,6 +59,26 @@ $notice = new \WPDesk\Notice\Notice('Notice text goes here');
Notice must be used before WordPress action `admin_notices`. WordPress admin actions order is listed [here](https://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_an_Admin_Page_Request).
## Project documentation
## Permanent dismissible notices
PHPDoc: https://wpdesk.gitlab.io/wp-notice/index.html
### AJAX handler
To use permanent dismissible notices AJAX handler must be created and hooks initialized:
```php
wpdesk_init_wp_notice_ajax_handler();
// Is equivalent to:
( new \WPDesk\Notice\AjaxHandler() )->hooks();
```
### Displaying
To display permanent dismissible notice:
```php
wpdesk_permanent_dismissible_wp_notice( 'Notice text goes here', 'notice-name' );
// Is equivalent to
$notice = new \WPDesk\Notice\PermanentDismissibleNotice( 'Notice text goes here', 'notice-name' );
```