Shortcode Always Shows Default Parameters

This is my shortcode:

function sectWithSidebar($atts, $content, $tag){
    //collect values, combining passed in values and defaults
    $values = shortcode_atts(array(
        'sectionHeading' => 'Section Heading',
        'sidebarHeading' => 'Sidebar Heading',
        'sidebarText' => 'Sidebar Text',
        'buttonURL' => "#",
        'classes' => ''
    ),$atts); 

    $output = '<div class="container section section-with-sidebar'.$values["classes"].'"><div class="row"><div class="col-sm-12"><h2>'.$values["sectionHeading"].'</h2></div></div><div class="row"><div class="col-md-8 col-sm-12"><span>'.$content.'</span></div><div class="col-md-4 col-sm-12"><div class="sidebar"><div class="sidebar-header">'.$values["sidebarHeading"].'</div><div class="sidebar-content">'.$values["sidebarText"].'<span class="learn-more-button"><a href="'.$values["buttonURL"].'">Learn More</a></span></div></div></div></div></div>';
    return $output;
}
add_shortcode('sectionWithSidebar','sectWithSidebar');

I am attempting to display it like this:

[sectionWithSidebar sectionHeading="Global Health" sidebarHeading="SidebarHeading" sidebarText="SidebarText" buttonURL="http://www.google.com"]
MSIH is a unique school that prepares physicians to address the impact of cultural, economic, political and environmental factors on the health of individuals and populations worldwide. It is the world's first and only medical school to incorporate core global health courses into all four years of an M.D. program. Classes are small, intimate and challenging. At MSIH, you learn to be not only a doctor, but a skilled physician with a comprehensive view of health around the world.
[/sectionWithSidebar]

However, it just displays the default content, as though I didn’t define any parameters when adding the shortcode to the page:
http://109.199.101.20/~newmsih/template-1-with-shortcodes/

Read more here: Shortcode Always Shows Default Parameters

Leave a Reply

Your email address will not be published. Required fields are marked *