0

I have a problem with the shortcode, it does not show me the values ​​I enter correctly

For example, this shortcode:

function subscribe_link_att($atts) {
    $default = array(
        'link'=>'',
        'title' => ''
);
    $a = shortcode_atts($default, $atts);

    return 'Follow us on <a href="'.$a['link'].'">'.$a['title'].'</a>';
    return ob_get_clean();

}
add_shortcode('subscribe', 'subscribe_link_att');

It shows me this:

Follow us on <a href="">’sqsqsc</a>

Current Wordpress version: 6.7.1

0

1 Answer 1

0

Your provided code does not show where this shortcode is used. By default, the values for "link" and "title" are null so unless you provide it with a new value the shortcode will return null.

try using [subscribe link="https://stackoverflow.com/" title="Stack Overflow"]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.