Skip to content
Snippets Groups Projects
Commit 47f95762 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

init

parent bdfb059d
No related branches found
No related tags found
No related merge requests found
Pipeline #6085 failed with stages
in 3 minutes and 38 seconds
{
"name": "wpdesk/wp-builder",
"name": "wpdesk/wp-notice",
"authors": [
{
"name": "GROla",
......@@ -8,8 +8,9 @@
],
"require": {
"php": ">=5.5",
"wpdesk/wp-basic-requirements": "dev-master"
},
"wpdesk/wp-basic-requirements": "dev-master",
"wpdesk/wp-builder": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "<7",
"wp-coding-standards/wpcs": "^0.14.1",
......@@ -19,7 +20,7 @@
"wimg/php-compatibility": "^8"
},
"autoload": {
"psr-4": {"WPDesk\\PluginBuilder\\": "src/"}
"psr-4": {"WPDesk\\Notice\\": "src/"}
},
"autoload-dev": {
},
......
......@@ -2,15 +2,26 @@
namespace WPDesk\Notice;
use WPDesk\PluginBuilder\Plugin\HookablePluginDependant;
use WPDesk\PluginBuilder\Plugin\PluginAccess;
/**
* Class Notice.
*
* @package WPDesk\Notice
*/
class AjaxHandler
class AjaxHandler implements HookablePluginDependant
{
use PluginAccess;
/**
* Hooks.
*/
public function hooks()
{
add_action();
}
}
......@@ -10,10 +10,10 @@ namespace WPDesk\Notice;
class DismissibleNotice extends Notice
{
/**
* @var string
*/
private $noticeDismissOptionName;
/**
* @var string
*/
private $noticeDismissOptionName;
/**
* WPDesk_Flexible_Shipping_Notice constructor.
......@@ -28,7 +28,17 @@ class DismissibleNotice extends Notice
$this->noticeDismissOptionName = $noticeContent;
}
protected
/**
* Get attributes as string.
*
* @return string
*/
protected function getAttributesAsString()
{
$attributesAsString = parent::getAttributesAsString();
$attributesAsString .= sprintf('data-dismiss-option="%1$s"', esc_attr($this->noticeDismissOptionName));
return $attributesAsString;
}
}
......@@ -36,11 +36,11 @@ class Notice
*/
protected $isDismissible;
/**
* Attributes.
*
* @var string[]
*/
/**
* Attributes.
*
* @var string[]
*/
protected $attributes = array();
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment