I found this, that function invokes a fairly large regex every time it is called.

I too found alternative to do_shortcode( ‘[shortcode]’ )

In the article there is the following code:

$old = do_shortcode( '' );
$new = do_single_shortcode( 'gallery', array( 'columns' => 2, 'ids' => '19,20,21,22' ) );

But how to apply it to which uses opening and closing tags [shortcode] [/ shortcode], there is also flanked content?

How change my this code to alternative:

<?php
  $my_linkdownload = get_post_meta( get_the_ID(), 'linkdownload', true);
  if( ! empty( $my_linkdownload ) ) {
echo do_shortcode('[pms-restrict subscription_plans="8"] <a href="' . $my_linkdownload . '" target="_blank"><img src="http://koran.pustakakoran.com/img/etc/pdf.png"> </a>[/pms-restrict]');
}
?>

Read more here: Alternative to do_shortcode( ‘[shortcode] $content [/shortcode]’ )


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: