Using both:
* {{admin_url}}
* {{nonce_field: my_now_photo, my_nonce_field}}
“{{nonce_field: my_now_photo, my_nonce_field}}” is being outputted as “my_now_photo, my_nonce_field “.
The admin URL doesn’t even show up in my form:
<form action="" method="post" enctype="multipart/form-data">
Latest everything is installed.
]]>Whenever I try to upload .js and .css files as a local resource, I’m getting this error: An error was thrown while trying to upload the resource: “Sorry, this file type is not permitted for security reasons.”
]]>I believe there may be a compatibility issue with Snippy and the new gutenberg editor. Does anyone know if this has been flagged? In doing some digging, I found that snippy is appearing before the DOCTYPE tag on the html – here is the start of the source code:
<div id=”snippy–mce-shortcode-popup” style=”display:none;”>
</div>
<!DOCTYPE html>
<!–[if IE 8]>
Over on github there appears to be a number of plugins that are appearing before the DOCTYPE tag and forcing the metaboxes (Yoast, likes, etc…) to block the “blocks” in the gutenberg editor.
It works if I deactivate the plugin, but I would love to keep using this plugin instead of moving to a different one
]]>I have a shortcode like this:
`
<div class=”container-fluid text-center text-{{color:black}} bg-{{bgcolor:light}}”>
<p>here is text</p>
</div>
`
If I do this, and call [myshortcode], I get
`
<div class=”container-fluid text-center text-black”>
<p>here is text</p>
</div>
`
which isn’t right, as it completely eliminated the second shortcode by greedy matching. It’s clear the current code is a bug.
The fix is in util.php in this regex. I’ve done a regex that will match anything but a } character instead of any character. Technically you’d probably want it to match two braces, but I think it’s clear a brace is an invalid character when using your plugin. You can of course make it work with the pair of braces if you wish.
`
— utils.bak 2018-03-21 23:01:15.669372954 -0400
+++ utils.php 2018-03-21 23:09:15.133401455 -0400
@@ -33,7 +33,7 @@
static public function replace_placeholders($placeholders, $html) {
foreach ($placeholders as $placeholder) {
$replacement = !empty($placeholder[‘value’]) ? $placeholder[‘value’] : Placeholders::get_placeholder_value($placeholder[‘name’]);
– $html = preg_replace(‘/{{‘. $placeholder[‘name’] .'(?::.+){0,1}}}/i’, $replacement, $html);
+ $html = preg_replace(‘/{{‘. $placeholder[‘name’] .'(?::([^}])+){0,1}}}/i’, $replacement, $html);
}
return $html;
}
`
Hi, can I put schema mark up and have it as a shortcode?
]]>Looking to add a default placeholder for the theme directory for future versions.
Example:
<img src="{{template_directory_uri}}/images/{{backgroundimg}}.png">
means we can do
[shortcode backgroundimg="child.jpg"]
without hardcoding a URL, making it adapt to future themes
# diff -urN includes/placeholders.{bak,php}
--- includes/placeholders.bak 2017-10-02 11:37:10.632457601 -0400
+++ includes/placeholders.php 2017-10-02 11:43:31.108480218 -0400
@@ -32,6 +32,11 @@
return \add_query_arg(array(), $wp->request);
}
+ // Returns the theme/template directory
+ if ($name == 'template_directory_uri') {
+ return \get_template_directory_uri();
+ }
+
/**
* PHP
*/
]]>
Is it possible to have the plugin process shortcodes in HTML content?
For example, if a bit (of HTML) includes [contact-form-7 id=”25″ title=”Inline”], it would be nice if it detected and processed the contact form in its place (ie: <?php echo do_shortcode(‘[contact-form-7 id=”25″ title=”Inline”]’); ?> )
I include a patch should you choose to accept it. Doing so opens the possibility of including other components, widgets, etc. within bits.
# diff -urN snippy.bak snippy.php
--- snippy.bak 2017-10-02 11:45:33.508487494 -0400
+++ snippy.php 2017-10-02 11:49:13.492500570 -0400
@@ -282,7 +282,7 @@
else if ($bit_type === 'html') {
// replace placeholders in html value
- $html = html_entity_decode($bit_value);
+ $html = do_shortcode(html_entity_decode($bit_value));
$placeholders_merged = Utils::merge_placeholders_and_atts($bit, $atts);
// if has content add content to placeholder
@@ -334,4 +334,4 @@
}
// go!
]]>