Adding Shortcode Values to wp_head
Adding Shortcode Values to wp_head
Adding Shortcode Values to wp_head
Let’s assume you have a javascript like this: function clickedTag( tag ) { var d = new Date(); console.log( ‘A word with tag ‘ + tag + ‘has been cliked at ‘ + d.toDateString() ); } And in your post you have this sentence: The quick brown fox jumps over the lazy dog And you … Read more
Foreach inside shortcode not working as planned
There are two solutions: Use the third argument for the shortcode. Use the use keyword. Examples The third parameter for each shortcode callback is the name of the shortcode: foreach ($files1 as $value) { $new_value = substr($value, 0, -4); add_shortcode($new_value, function( $attributes, $content, $shortcode ) { return ‘<img src=”‘ . PATH . L_ITEMS . $shortcode … Read more
Hide shortcodes “code” when using the “editor” the same as wordpress do with “gallery”
why not set white-space : normal ? https://developer.mozilla.org/en-US/docs/Web/CSS/white-space without seeing the rest of your css, its hard to determine why the text isn’t wrapping naturally
You should give the Attributes Section of the Shortcode API WordPress Codex page a read. Unquoted values also must never contain spaces. Short summary, use quotes – either ” or ‘ – for attribute values with a space in it. Because an attribute name isn’t actually needed I think the »Info« part of your name … Read more
display-posts shortcode attributes have no effect
You should always sanitize all inputs regardless of who or where they are coming from. Not only is it good practice (which helps ensure that you don’t accidentally get comfortable skipping it and miss it elsewhere), but it ensures that that particular feature is secure in the future. For example, you may wish to expand … Read more
As I already stated in comments, extract() should never be used. It was removed from core and the codex for very specific reasons and the use there of is strictly not recommended in future applications and functions. Please see trac ticket #22400 for complete details. As stated before, the codex was also updated accordingly, so … Read more