Skip to content

Commit

Permalink
Fixed Variable
Browse files Browse the repository at this point in the history
- Updated variable to be $args
- Updated comment to correct shortcode example
  • Loading branch information
SnowB1 committed Dec 22, 2022
1 parent 1e34693 commit 0efb43e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/NewsletterShortcodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class NewsletterShortcodeProvider extends ShortcodeParser{
/*
[newsletter,class="form newsletter-form"]
[newsletterform,class="form newsletter-form"]
*/
public static function handle_shortcode($args, $content, $parser, $shortcode, $extra = array()){
$PopupContent = '';
Expand All @@ -16,16 +16,16 @@ public static function handle_shortcode($args, $content, $parser, $shortcode, $e
$PopupContent = $parser->parse($content);
}
// If class add wrapper div
if (isset($arguments['class'])){
$PopupContent .= '<div class="'.$arguments['class'].'">';
if (isset($args['class'])){
$PopupContent .= '<div class="'.$args['class'].'">';
}
// Get Form HTML
$PopupContent .= Controller::curr()->NewsletterForm()
->setHTMLID("NewsletterForm".rand(0,100))
->setFormAction(Controller::join_links(Controller::curr()->owner->Link(), 'NewsletterForm'))
->forTemplate();
// End wrapper div
if (isset($arguments['class'])){
if (isset($args['class'])){
$PopupContent .= '</div>';
}
// Return full html
Expand Down

0 comments on commit 0efb43e

Please sign in to comment.