Home Forums Newsletter Plugin Support Modification Request – Nested Shortcodes

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #139137
    Anonymous
    Inactive

    In trying to make a simple profile page that displays the subscribe form if a subscription cannot be found, I discovered that the Newsletter Profile shortcode does not currently support nested shortcodes. If it did, then my profile page could just be:

    [newsletter_profile][newsletter_form][/newsletter_profile]

    I went ahead and modified the relevant code in /newsletter/profile/profile.php but this solution isn’t ideal as it will break every time you update the plugin. Would it be possible for you to add the following do_shortcode() to the plugin?

    function shortcode_newsletter_profile($attrs, $content) {
            $user = $this->check_user();
    
            if (empty($user)) {
                if (empty($content)) {
                    return __('Subscriber not found.', 'newsletter');
                } else {
                    return do_shortcode($content);
                }
            }
    
            return $this->get_profile_form($user);
        }
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.