How can I extract or parse data from post contents’ shortcodes into an array?
Not really a WordPress question, but you can use the PHP function preg_match_all to extract all the text wrapped in [cs_text] tags like so: function wpse_265295_extract_cs_text( $subject ) { $pattern = “#\[cs_text\](.*?)\[/cs_text\]#s”; preg_match_all( $pattern, $subject, $matches ); return isset( $matches[1] ) ? $matches[1] : []; } If you’re looking to extract arbitrary shortcodes: if( ! … Read more