Problem with multiple shortcode in page template
Problem with multiple shortcode in page template
Problem with multiple shortcode in page template
The problem you’re facing is because of the nature of the WordPress redirect. It uses what is called a safe redirect, namely with the function wp_safe_redirect(). This restricts redirects to local URLs only. Your work around for this is the following where you jump into the login redirect filter and perform your desired redirection then, … Read more
Edit shortcode in post content programatically
Shortcode: text content ends up outside html tags
WordPress TinyMCE : Get value of popup button
1.- Add this to your child theme’s functions file: add_filter(“embed_oembed_html”, function( $html, $url, $attr ) { if ( !empty( $attr[‘id’] ) ) { $html = str_replace( “<iframe”, sprintf( ‘<iframe id=”%s”‘, $attr[‘id’] ), $html ); } return $html; }, 10, 3); 2.- Now use ‘ ); Hope that helps.
If you only have 1 shortcode in the post content, catch the id with this: <?php $text = get_the_content(); preg_match_all(“\bid=”([0-9]+)\b”, $text, $matches); var_dump($matches[0]); ?> In your example [gravityform description=”true” id=”23″ title=”true”], it would output: 23 However, if you use other shortcodes or simple text, in the same post, with that same structure id=123, you might … Read more
WordPress applies various filters to the content before it is output. The filter do_shortcode is the one that processes shortcodes. You can apply all of the same filters to the output of your editor by using the following code: echo apply_filters( ‘the_content’, get_option( ‘piedino_plugin_var_testo’ ) ); Here is the list of all of the filters … Read more
First, what you are trying to do is an abuse of the shorcode system. You should not use them to replace html elements. That aside, the p comes from the content. You either need to use [div]….[/div] and than you will get the content as the second parameter to the shortcode function and you can … Read more
use function to call variable function give_value(){ $acfvalue = get_field( ‘short_title’ ); return $acfvalue; } function hprice(){ return ‘<h2>’. give_value() . ” Price list in India” .'</h2>’; } add_shortcode( ‘pprice’, ‘hprice’ ); function hspecs(){ return ‘<h2>’. give_value() . ” Full Specification” . ‘</h2>’; } add_shortcode( ‘pspecs’, ‘hspecs’ ); function hreview(){ return ‘<h2>’. give_value() . ” … Read more