diff --git a/src/TextPetition.php b/src/TextPetition.php index fdda3fc9e076a8eccadb6c5f10442f84899d1943..661ee2512897fa70614737d51bb6cd5643ebb8aa 100644 --- a/src/TextPetition.php +++ b/src/TextPetition.php @@ -44,18 +44,31 @@ class TextPetition implements Hookable { /** * @param string $display_on_action * @param DisplayDecision $display_decision + * @param string $plugin_author + * @param string $plugin_title + * @param string $rating_url + * @param string $text_align */ - public function __construct( string $display_on_action, DisplayDecision $display_decision ) { + public function __construct( string $display_on_action, DisplayDecision $display_decision, string $plugin_author, string $plugin_title, string $rating_url, string $text_align = 'center' ) { $this->display_on_action = $display_on_action; $this->display_decision = $display_decision; + $this->text_align = $text_align; + $this->plugin_author = $plugin_author; + $this->plugin_title = $plugin_title; + $this->rating_url = $rating_url; } + public function hooks() { add_action( $this->display_on_action, [ $this, 'display_petition_if_should' ] ); } public function display_petition_if_should() { if ( $this->display_decision->should_display() ) { + $text_align = $this->text_align; + $plugin_author = $this->plugin_author; + $plugin_title = $this->plugin_title; + $rating_url = $this->rating_url; include __DIR__ . '/views/html-text-petition.php'; } }