How to apply an ID to Shortcode Embedded iframe

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.

Gravity forms – get shortcode attribute from post content

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

Remove ‘p’ tags around shortcodes and ‘img’

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

Create shortcode in WordPress, using one variable in 3 functions?

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)