Custom Shortcode AJAX 400 Bad Request

The problem is that you’re attempting to use the arguments for the jQuery AJAX API with the native Fetch API. Specifically, the problem is that the JS Fetch API doesn’t support a data argument. For an admin-ajax.php request to work in WordPress the $_REQUEST[‘action’] property needs to be populated, and to do this with the … Read more

Video embeds work in backend, but are not parsed in frontend

I’ve just looked at the source of the WP_Embed class, and it appears they are not actually registering a shortcode, but hooking into the the_content filter. Change your code to $content_desktop = apply_filters(“the_content”, get_the_content()); or manually trigger their filter with something like $content_desktop = WP_Embed::run_shortcode(get_the_content()); or, if you prefer to have an object: $myembeds = … Read more

Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [closed]

You should try running WP-CLI’s search-replace command. $ wp search-replace ‘http://example.com’ ‘https://example.com’ –all-tables But you said these URLs are placed from a shortcode? Then you need to find out what this shortcode actually is doing. As it not necessarily has saved the URLs to the database. Maybe it’s a setting in the shortcode and then … Read more

Shortcodes, HTML tables, and multiple rows

pass your data in single variables delimited by some char: [myproduct cols=”name,quantity,price” data=”name1,5,2.00,name2,3,3.25″] then explode it into an array and output. I didn’t bother with table markup here, but you get the idea: function myproduct_func( $atts ) { extract( shortcode_atts( array( ‘cols’ => ‘none’, ‘data’ => ‘none’, ), $atts ) ); $cols = explode(‘,’,$cols); $data … Read more

Videos via the video shortcode are always 640px wide?

That width is dictated by the $content_width global, defined by the Theme. To change it, you’ll need to hook into after_setup_theme and modify it: function wpse124075_setup_theme() { global $content_width; if ( ! isset( $content_width ) ) { $content_width = 640; // your value here, in pixels } } add_action( ‘after_setup_theme’, ‘wpse124075_setup_theme’ );

shortcode_unautop shortcode not functioning

The above solution doesn’t work if you’re using Advanced Custom Fields. When using ACF, the following code does work: remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘acf_the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘wpautop’ , 99); add_filter( ‘acf_the_content’, ‘wpautop’ , 100); add_filter( ‘the_content’, ‘shortcode_unautop’,110 ); add_filter( ‘acf_the_content’, ‘shortcode_unautop’,111 );

Stop strip_shortcodes() stripping content inside shortcodes

Try the filters in your functions.php: add_filter( ‘the_excerpt’, ‘shortcode_unautop’); add_filter( ‘the_excerpt’, ‘do_shortcode’); Props: @bainternet (Source) Or, use your own filter on get_the_excerpt. Put this in your theme’s functions.php: function custom_excerpt($text=””) { $raw_excerpt = $text; if ( ” == $text ) { $text = get_the_content(”); // $text = strip_shortcodes( $text ); $text = do_shortcode( $text ); … Read more

shortcode for logo image

Change ‘name’ => ”, to ‘name’ => ‘logo’, Then when there is no name field passed to the shortcode, it will default to logo, which will load logo.png.

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