I’m referring to this question. Is it possible to extract()
values from an associative array with hyphens/dashes in their keys by now?
It’s about an older version of the WordPress Shortcode API. Example:
function bartag_func( $atts ) { extract( shortcode_atts( array( 'foo-bar' => 'something' ), $atts ) ); return "foo = ${foo-bar}"; } add_shortcode( 'bartag', 'bartag_func' );
Advertisement
Answer
It is still not possible. However, for the PHP.net engine, I have an RFC under discussion that would make it possible in PHP 8.