Video shortcode, option are not rendered

You haven’t assign for $atts. So suprised that the poster can work correctly. function video_custom($atts) { extract(shortcode_atts(array( ‘option’ => ”, ‘poster’ => ”, ‘src’ => ”, ‘type’ => ”, ), $atts)); return ‘<div class=”d-flex justify-content-center”><video class=”wp-video” ‘ . $option . ‘ poster=”‘ . $poster . ‘”><source src=”‘ . $src . ‘” type=”video/’ . $type . … Read more

Dynamic number within shortcode

Shortcodes are plain text wrapper made exactly for cases when PHP code is not available or should not be used. You can concatenate that to string and evaluate it with do_shortcode(). You can look up function that powers shortcode (set up with add_shortcode()) and use it in PHP code directly.