In my posts on WordPress I have an unknown number of shortcodes of type my_player that I created and correctly added hooks to. I was wondering if there is some type of WordPress function you can pass your content to and shortcode name, and it could give you an array of matched shortcodes with their attributes indexed by attribute name. Something like my code below...
$matches = get_shortcode_matches($content, "my_player");
for($i = 0; $i < sizeof($matches); $i++)
{
$title = $matches[$i]['title'];
$mp3 = $matches[$i]['mp3'];
$soundcloud = $matches[$i]['soundcloud'];
}
I know that when you create the hook for the shortcodes using the add_shortcode() function you can use these indexed values like I have above, but I need to have a function that can access them later and outside of the loop. Does WordPress have any such function?