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

feature(petition): added text petition

parent cac1b8c8
No related branches found
No related tags found
1 merge request!1feature(petition): added text petition
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
<?php
namespace WPDesk\RepositoryRating\DisplayStrategy;
/**
* DisplayDecision - always display.
*/
class AlwaysDisplayDisplayDecision implements DisplayDecision {
/**
* Should display?
*
* @return bool
*/
public function should_display(): bool {
return true;
}
}
\ No newline at end of file
......@@ -22,7 +22,7 @@ class GetParametersDisplayDecision implements DisplayDecision {
}
/**
* Should Beacon be visible?
* Should display?
*
* @return bool
*/
......
......@@ -20,6 +20,16 @@ class TextPetition implements Hookable {
*/
private $display_decision;
/**
* @param string $display_on_action
* @param DisplayDecision $display_decision
*/
public function __construct( string $display_on_action, DisplayDecision $display_decision ) {
$this->display_on_action = $display_on_action;
$this->display_decision = $display_decision;
}
public function hooks() {
add_action( $this->display_on_action, [ $this, 'display_petition_if_should' ] );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment