I'm trying to push a shortcode parameter value to a template file but for some reason I can't get the array value that I'm targeting into a single variable. Here is my code and the shortcode I'm using:
function content_table($atts) {
$atts = shortcode_atts(array(
'tablepageid' => ''
), $atts);
include(locate_template('table-layout.php'));
}
add_shortcode('ContentTable', 'content_table');
Edit I removed the quotes from my shortcode and I'm now able to see the value: [ContentTable tablepageid=4799]
I created a page to test the shortcode function:
print_r(array_values($atts));
Array ( [0] => 4799 )
The value from the shortcode is available but I'm having some trouble getting the value into a variable for my template to use:
$arr = $atts[0];
The $arrTable variable is empty...I can't figure out why it's not 4799.