I have several snippets that have an h4 title and then a link underneath. When adding the snippet, it’s adding a <br> between the title and link that’s not in the original code.
]]>I realize in some cases the snippet content could be very long, but I think a column, on the PS admin page, which shows the snippet content is very useful.
Its rather easy and processing it as shown below, in function column_default
, keeps it under control
$content = nl2br2 (htmlspecialchars ($item[ $column_name]));
$content = mb_strimwidth($content, 0, 200, " ...");
My nl2br2 is just
str_replace (array ("\r\n", "\r", "\n"), "[BR]", $string);
]]>
So, I am using a post-snippet with javascript to generate the shopify purchase buttons.
I wanted to create a single snippet and pass the BookID into it by variable (that way, I only have to change the homepage shortcode and it would pull the correct book)
However, if I try to pass the bookid like so
<div id='product-component-{bookid}'></div>
and then in the javascript section
ShopifyBuy.UI.onReady(client).then(function (ui) {
ui.createComponent('product', {
id: '{bookid}',
node: document.getElementById('product-component-{bookid}'),
...
and the shortcode
[preorderbook 1234567890]
I get nothing… the variable is never passed….
]]>Is there a process to migrate snippets from v3 to v4? I have over 100+ that work fine on v3.1.7 but they vanish after upgrading to v4.0.5.
Exporting from v3 and importing after updating to v4 unfortunately did not import anything.
]]>I’m having a problem with Post Snippets shortcodes not rendering in a synced pattern that been inserted on a page via the page template of the Frost FSE theme. The shortcodes do render just fine in the content area as well as in the header, but not in my particular synced pattern. You can see this issue on the page via the link I’ve provided. Thanks for any help you can provide.
]]>I’m creating separate shortcode snippets for links to my social media profile icons (external links). Each URL in the snippet editor field is formatted as follows: https://example.com
and the shortcode is formatted as follows [example].
The shortcode is then added manually to button URL fields across the site. These work as expected inside the content areas, however, when used in the site footer area, these shortcodes’ links are prepended with the URL of the current page and the shortcode isn’t being executed, so links on these buttons look as follows:
https://mydomain.com/current-page/[example]
It appears that WordPress is prepending my shortcodes in the site footer with the current page’s URL and preventing the shortcode from executing.
Is there a function I can add that will prevent this?
]]>For the love of saving everybody’s time just check your code before going live with new updates.
Empty space in /src/PostSnippets/Elementor_blocks/reg_ps_elementor_src_block.php before <?php kills your sitemap with XML Parsing Error.
The whole plugin needs some cleanup with all these empty spaces, especially at the end of files. Takes max an hour to clean it up and get some halfway organized code.
]]>This plugin is beautiful. But, I was unable to import snippets to another site in my network. I received this error: Snippets could not be imported: Sorry, you are not allowed to upload this file type.
Thanks for your help.
]]>After Post Snippets (Premium) upgrade from version 4.1.1 to 4.2. The snippets now appear as plain text:
<a style=\"float:right; margin-top:-1em;\" href=\"https://www.500yojanas.org/stone-last-age/\" rel=\"noopener noreferrer\" target=\"_blank\">Stone: Seeking Enlightenment in the Last Age, p46 of Part</a>
<br />
Earlier, before the upgrade, PostSnippets was demanding a database update on every load of the admin page. I clicked on the link many, many times.
]]>I was just working on my site and need to duplicate some post snippets, and when I click the option to duplicate, I see the error:
There has been an Error..
I tried to create a snippet from scratch, and see:
Snippet Not Added..
If I click edit, I can change the snippet, but when I click save, I get:
Snippet Update Failed..
I turned on WordPress Debug, and see the two following errors from your plugin.
Warning: Undefined array key “snippet_slug” in?/home/martin/public_html/wp-content/plugins/post-snippets-premium/src/PostSnippets/PSallSnippets.php?on line?295
Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in?/home/martin/public_html/wp-content/plugins/post-snippets-premium/src/PostSnippets/PSallSnippets.php?on line?295
Please take a look at this, and hopefully provide a solution soon. I have to update my site and I’m stuck without your plugin.
Regards,
Martin Bailey.
On the admin page “All Snippets” the WordPress footer is positioned higher on the page than normal (see image). This only happens on the PostSnippets “All Snippets” and “News” admin pages.
]]>Hi. Forgive me if I’m misunderstanding how Snippets works but I’m trying to make a simple snippet as per the attached image. It contains three lines of information, I wish to set a variable to each of the lines and then, in my WordPress page, add just one of the variables at the required place. I’ve included an image of what I’ve tried but it fails, all I see are the three lines, not just one of them. What I’d like to achive is a line of text on my webpage that says something like
‘My name is Micky Mouse, my email address is [email protected] or you can phone me on 01234 567890.’
Can I do what I’m trying to achieve in Snippets or do I need to make three separate snippets, one line and one variable? Thanks
]]>I’m trying to make a simple snippet of text, a url. I’m finding when I add the shortcode for the snippet to a social icon e.g. Facebook, the colon out of the url is removed therefore the icon doesn’t work. If I simply add a shortcut widget and set it to the value of the snippet shortcut then yes, the colon is included. How should I make a snippet for a simple url in a Social icon? Thanks
]]>Hello,
When I add google adsense to a snippet and try to insert it it doesn’t add it correct (looks like this https://ibb.co/rf3dFMw )
Some how it’s not parsing it correctly to insert into my wordpress article and when i publish it, it gets all messed up.
A bug? Or can you give me advice on how to properly add to a snippet so that it appears correctly in my article?
thank you,
Matt
After updating to Post Snippets 4.0.3 i am getting a parse error:
Parse error: syntax error, unexpected ‘>’, expecting end of file in?…/wp-content/plugins/post-snippets/src/PostSnippets/Shortcode.php(110) : eval()’d code?on line?1
Is there a problem with a single snippet or with the plugin itself? How do i find out which one it is?
Thanks for help!
I received this alert about an XSS vulnerability in 4.0.2. Please release an update to fix this ASAP.
]]>Hello,
In the user role editor within wordpress, what is the slug in the user role editor for the post snippets plugin that would allow me to grant permission to a specific role (i.e. “Editor”)
thank you,
Matt
]]>code like
wp_editor(stripslashes($snippet_desc)...
needs to be checked for passing null.
in php 8.1, functions like stripslashes, strpos, … no longer accept null. An empty string should be used
]]>After updating from 3.1.7 to 4.0.2, the 1 snippet in the site disappeared. I rolled back to 3.1.7 and exported the snippet, then updated to 4.0.2 and imported the snippet. It still didn’t appear. I then manually recreated the snippet, but when trying to save it, I just got a “Snippet Not Added..” error. I tried changing the name of the snippet, but that didn’t help. The code editor didn’t show any errors with the code. What can be done to fix this?
]]>Hello!
If I use Gutenberg’s block editor all custom variables are shown. But where is the possibility to fill the {content} variable? I have been searching for a while but did not find anything. What am I doing wrong?
Thanks!
Heiko
Hello!
I have been using this snippets for years. But now it breaks my site. I can not see the cause of the problem. In the snippet editor I got a white “x” on a red circle with the following message on the last line:
e is undefined
The code of the snippet is:
if(strpos({mehrbezeichnung}, 'keine' ) === false)
{
echo '
<div class="termin grid-container grid-parent">
<div class="datum mobile-grid-100 tablet-grid-20 grid-20">{datum}</div>
<div class="beschreibung mobile-grid-100 tablet-grid-80 grid-80">
<span class="titel">{titel}</span><span class="zusatz-titel">{zusatztitel}</span>
[showhide type="{mehrbezeichnung}" more_text="Mehr Informationen..." less_text="Weniger Informationen..."]{content}[/showhide]
</div>
</div>';
}
else {
echo '
<div class="termin grid-container grid-parent">
<div class="datum mobile-grid-100 tablet-grid-20 grid-20">{datum}</div>
<div class="beschreibung mobile-grid-100 tablet-grid-80 grid-80">
<span class="titel">{titel}</span><span class="zusatz-titel">{zusatztitel}</span>
</div>
</div>';
}
On the frontend I got this error message:
Fatal error: Uncaught Error: Undefined constant "keine" in .../PostSnippets/Shortcode.php(110) : eval()'d code:1 Stack trace: #0 .../PostSnippets/Shortcode.php(110): eval() #1 .../PostSnippets/Shortcode.php(63): PostSnippets\Shortcode::phpEval('if(strpos(keine...') #2 .../PostSnippets/Shortcode.php(29): PostSnippets\Shortcode::evaluateSnippet(Array, Array, '') #3 .../wp-includes/shortcodes.php(355): PostSnippets\Shortcode->PostSnippets\{closure}(Array, '', 'Termin') #4 [internal function]: do_shortcode_tag(Array) #5 .../wp-includes/shortcodes.php(227): preg_replace_callback('/\\[(\\[?)(Termin...', 'do_shortcode_ta...', '<h2>Februar</h2...') #6 .../wp-includes/class-wp-hook.php(308): do_shortcode('<h2>Februar</h2...') #7 .../wp-includes/plugin.php(205): WP_Hook->apply_filters('<h2>Februar</h2...', Array) #8 .../wp-includes/post-template.php(255): apply_filters('the_content', '<!-- wp:heading...') #9 .../wp-content/themes/generatepress/content-page.php(73): the_content() #10 .../wp-includes/template.php(785): require('/var/www/web296...') #11 .../wp-includes/template.php(718): load_template('/var/www/web296...', false, Array) #12 .../wp-includes/general-template.php(204): locate_template(Array, true, false, Array) #13 .../wp-content/themes/generatepress/inc/theme-functions.php(568): get_template_part('content', 'page') #14 .../wp-content/themes/generatepress/page.php(34): generate_do_template_part('page') #15 .../wp-includes/template-loader.php(106): include('/var/www/web296...') #16 .../wp-blog-header.php(19): require_once('/var/www/web296...') #17 .../index.php(17): require('/var/www/web296...') #18 {main} thrown in .../PostSnippets/Shortcode.php(110) : eval()'d code on line 1
Can anyone help with this problem? I would really would be glad if someone could solve the problem.
I use the latest plugin version and PHP 8.0.
Thanks in advance!
Heiko
Hi, very helpful plugin you got there! Since the last update content doesn’t seem to have any line breaks in them when imported into the backend text editor from WordPress. I see the blank lines in the code when checking the singular snippets within the plugin’s options, but when clicked on the button in the editor, the text gets pushed together without any formatting and is not usable in that form. ??
FYI: Still using the old text editor, not the new Gutenberg block one (but this worked fine before).
I have variables in my shortcode snippets like pdf-filename. v4.0.1 removes the – from my variables so I get pdffilename which, of course, breaks the shortcode. I tried editing the variables back to pdf-filename but the change is not stored. I have reverted to 3.1.7. Will there be a fix for this?
]]>Hi there,
after the last update I get the error message:
Post Snippets (free) requires WordPress version 5.8 or greater.
My WP still runs on 5.7.8 – but on the plugin sites there stands that the plugin still runs with 3.3 or higher… I would not have it updated, when there had stand 5.8 :o(
The plugin works still on the old sites, but I cannot use it anymore on the editor…
So is it just a bug, will it be changed, or do I really need to update my WP to use Post Snippets in Future? And will it break my site, if I still have it active or need I deactivate it`?
]]>The 4.0 release introduced a bug where all html links are wrapped in extra erroneous quotation marks. This effectively breaks any html anchor tags that are added via the plugin. I’ve rolled back to 3.1.7 until a fix is released.
]]>Hi all,
Some of my admin pages were looking incorrect and I noticed that post-snippets.css has a “.handle” class applied to all of /wp-admin. Going through the file, some other classes like “.dashed-placeholder” and others feel like they could be used by WP or other plugins too and should probably be scoped to only apply within Post Snippets, don’t you think?
Thanks!
]]>Hi, I noticed 2 bugs in your gutenberg block that need fixing. For now I modified your code in /dist/blocks.build.js and enqueued a copy from my theme to fix those. 1st bug is that if you have 2 blocks on one page it will only save fields and then render 1st block – because you create a global var vars_dirty for all blocks which stores vars from only one block. And 2nd bug is you can’t add a space in var text input field because you join() and split() them by spaces when editing those fields. Here’s my tweaked code if you want – i decoded eval() code on line 87 and modified resulting to store vars as json string and not rely on spaces or vars_dirty.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/*!***********************!*\
!*** ./src/blocks.js ***!
\***********************/
/*! no exports provided */
/*! all exports used */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__block_block_js__ = __webpack_require__(/*! ./block/block.js */ 1);\n/**\n * Gutenberg Blocks\n *\n * All blocks related JavaScript files should be imported here.\n * You can create a new block folder in this dir and include code\n * for that block here as well.\n *\n * All blocks should be included here since this is the file that\n * Webpack is compiling as the input file.\n */\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9ja3MuanM/N2I1YiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEd1dGVuYmVyZyBCbG9ja3NcbiAqXG4gKiBBbGwgYmxvY2tzIHJlbGF0ZWQgSmF2YVNjcmlwdCBmaWxlcyBzaG91bGQgYmUgaW1wb3J0ZWQgaGVyZS5cbiAqIFlvdSBjYW4gY3JlYXRlIGEgbmV3IGJsb2NrIGZvbGRlciBpbiB0aGlzIGRpciBhbmQgaW5jbHVkZSBjb2RlXG4gKiBmb3IgdGhhdCBibG9jayBoZXJlIGFzIHdlbGwuXG4gKlxuICogQWxsIGJsb2NrcyBzaG91bGQgYmUgaW5jbHVkZWQgaGVyZSBzaW5jZSB0aGlzIGlzIHRoZSBmaWxlIHRoYXRcbiAqIFdlYnBhY2sgaXMgY29tcGlsaW5nIGFzIHRoZSBpbnB1dCBmaWxlLlxuICovXG5cbmltcG9ydCAnLi9ibG9jay9ibG9jay5qcyc7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvYmxvY2tzLmpzXG4vLyBtb2R1bGUgaWQgPSAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n");
/***/ }),
/* 1 */
/*!****************************!*\
!*** ./src/block/block.js ***!
\****************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */
var __WEBPACK_IMPORTED_MODULE_0__editor_scss__ = __webpack_require__( /*! ./editor.scss */ 2);
/* harmony import */
var __WEBPACK_IMPORTED_MODULE_0__editor_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__editor_scss__);
/* harmony import */
var __WEBPACK_IMPORTED_MODULE_1__style_scss__ = __webpack_require__( /*! ./style.scss */ 3);
/* harmony import */
var __WEBPACK_IMPORTED_MODULE_1__style_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__style_scss__);
/* harmony import */
var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__( /*! lodash */ 4);
/* harmony import */
var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
/**
* BLOCK: post-snippets-block
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
// Import CSS.
var __ = wp.i18n.__; // Import __() from wp.i18n
var registerBlockType = wp.blocks.registerBlockType; // Import registerBlockType() from wp.blocks
var _wp$components = wp.components,
SelectControl = _wp$components.SelectControl,
TextControl = _wp$components.TextControl;
registerBlockType('greentreelabs/post-snippets-block', {
title: __('Post Snippets'),
icon: 'admin-plugins',
category: 'common',
keywords: [__('post snippets'), __('snippets')],
attributes: {
snippet: {
type: 'string'
},
vars: {
type: 'string'
},
shortcode: {
type: 'boolean'
},
text_fields: {
type: 'array'
}
},
edit: function edit(props) {
var _props$attributes = props.attributes,
snippet = _props$attributes.snippet,
vars = _props$attributes.vars,
text_fields = _props$attributes.text_fields,
shortcode = _props$attributes.shortcode;
console.log("text_fields", text_fields);
var options = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.concat([{
label: __('----'),
value: ""
}], post_snippets_s.map(function(s) {
return {
label: s.title,
value: s.title
};
}));
function save(s, v) {
let vars_obj = JSON.parse( vars );
vars_obj[s] = v;
props.setAttributes({
vars: JSON.stringify( vars_obj )
});
}
function getVarValue(field) {
if (!vars) return "";
let vars_obj = JSON.parse( vars );
return vars_obj[field];
}
return wp.element.createElement(
'div',
null,
wp.element.createElement(SelectControl, {
label: 'Snippet',
value: snippet,
options: options,
onChange: function onChange(v) {
props.setAttributes({
snippet: v
});
var s = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.find(post_snippets_s, function(e) {
return e.title == v;
});
var fields = s.vars != "" ? s.vars.split(",") : [];
props.setAttributes({
text_fields: fields,
vars: JSON.stringify( fields.reduce((a, key) => Object.assign(a, { [key]: '' }), {}) )
});
props.setAttributes({
shortcode: s.shortcode != "0"
});
}
}),
text_fields ? text_fields.map(function(e) {
return e ? wp.element.createElement(TextControl, {
label: e,
value: getVarValue(e),
onChange: function onChange(v) {
save(e, v);
}
}) : "";
}) : ""
);
},
save: function save(props) {
console.log("save");
console.log(props);
let vars_obj = JSON.parse( props.attributes.vars );
let vars_str = '';
for ( const v in vars_obj ) {
vars_str += v + '="' + vars_obj[v] + '" ';
}
return wp.element.createElement(
'div',
null,
props.attributes.shortcode ? "[" : "",
props.attributes.snippet,
' ',
vars_str,
props.attributes.shortcode ? "]" : ""
);
}
}); //# sourceURL=[module]
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9ibG9jay5qcz85MjFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQkxPQ0s6IHBvc3Qtc25pcHBldHMtYmxvY2tcbiAqXG4gKiBSZWdpc3RlcmluZyBhIGJhc2ljIGJsb2NrIHdpdGggR3V0ZW5iZXJnLlxuICogU2ltcGxlIGJsb2NrLCByZW5kZXJzIGFuZCBzYXZlcyB0aGUgc2FtZSBjb250ZW50IHdpdGhvdXQgYW55IGludGVyYWN0aXZpdHkuXG4g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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9
//# sourceURL=webpack-internal:///1
/***/ }),
/* 2 */
/*!*******************************!*\
!*** ./src/block/editor.scss ***!
\*******************************/
/*! dynamic exports provided */
/***/ (function(module, exports) {
eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9lZGl0b3Iuc2Nzcz80OWQyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvYmxvY2svZWRpdG9yLnNjc3Ncbi8vIG1vZHVsZSBpZCA9IDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n");
/***/ }),
/* 3 */
/*!******************************!*\
!*** ./src/block/style.scss ***!
\******************************/
/*! dynamic exports provided */
/***/ (function(module, exports) {
eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9zdHlsZS5zY3NzPzgwZjMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gcmVtb3ZlZCBieSBleHRyYWN0LXRleHQtd2VicGFjay1wbHVnaW5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL3NyYy9ibG9jay9zdHlsZS5zY3NzXG4vLyBtb2R1bGUgaWQgPSAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3\n");
/***/ }),
/* 4 */
/*!*************************!*\
!*** external "lodash" ***!
\*************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports) {
module.exports = lodash;
/***/ })
/******/ ]);
]]>
Hello,
When I updated to v. 4.0 it seemed to break something in the admin where the menu/nav is not visible and I can’t even access anything on any of the admin pages. I had to deactivate the plugin and revert back to 3.1.7.
See here:
https://www.dropbox.com/s/9icjrqzxdgf8xky/Notification_Center-3.jpg?dl=0
thank you,
Matt
Hi,
I have never had a problem with this plugin. But now it posts a lengthy string in the top part of every wp-admin page:
style=\"display:inline-block;width:728px;height:90px\"
data-ad-client=\"ca-pub-9341399866480111\"
data-ad-slot=\"5728084784\">
"; var postsnippet_1 = ""; var postsnippet_2 = ""; var postsnippet_3 = "
"; jQuery(document).ready(function($){ // We do the check to see if post snippets dialog is in the footer. // Some plugins, like 'download monitor' uses WordPress admin bootstrap and // then bring in admin_head but not admin_footer. So to allow other plugins // to do that 'hack', we bail out in thoise cases. if ($("#post-snippets-tabs").length>0) { if($.isFunction($().tabs)){ // Ensure the tabs function is available var tabs = $("#post-snippets-tabs").tabs(); } $(function() { if($.isFunction($().dialog)){ // Ensure the dialog function is available $("#post-snippets-dialog").dialog({ autoOpen: false, modal: true, dialogClass: 'wp-dialog', buttons: { Cancel: function() { $(this).dialog("close"); }, "Insert": function() { $(this).dialog("close"); var selected = tabs.tabs('option', 'active'); if (selected == 0) { insert_snippet = postsnippet_0; } if (selected == 1) { insert_snippet = postsnippet_1; } if (selected == 2) { insert_snippet = postsnippet_2; } if (selected == 3) { insert_snippet = postsnippet_3; } // Decide what method to use to insert the snippet depending // from what editor the window was opened from if (post_snippets_caller == 'html') { // HTML editor in WordPress 3.3 and greater QTags.insertContent(insert_snippet); } else { // Visual Editor post_snippets_canvas.execCommand('mceInsertContent', false, insert_snippet); } } }, width: 500, }); } }); } }); // Global variables to keep track on the canvas instance and from what editor // that opened the Post Snippets popup. var post_snippets_canvas;
My wp-admin looks like this: https://ibb.co/wzR6Vvc
How to fix it?
]]>Hi, first of all thanks for your plugin!
On this last update (4.0) I got “the email” that wordpress found an error with one of my plugins, Post Snippets (free).
With the following error details:
E_ERROR en la línea 44 del archivo /home/****/****.com/wp-content/plugins/post-snippets/views/jquery_ui_dialog_footer.php. Mensaje de error: Uncaught Error: Call to undefined method PostSnippets\Shortcode::filterVars() in /home/****/****.com/wp-content/plugins/post-snippets/views/jquery_ui_dialog_footer.php:44
Stack trace:
#0 /home/****/****.com/wp-content/plugins/post-snippets/src/PostSnippets/View.php(21): include()
#1 /home/****/****.com/wp-content/plugins/post-snippets/src/PostSnippets/WPEditor.php(241): PostSnippets\View::render('jquery_ui_dialo...', Array)
#2 /home/****/****.com/wp-includes/class-wp-hook.php(308): PostSnippets\WPEditor->addJqueryUiDialog('update.php')
#3 /home/****/****.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#4 /home/****/****.com/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /home/****/****.com/wp-admin/includes/template.php(2157): do_action('admin_footer', 'update.php')
#6 /home/****/****.com/wp-admin/update.php(53): iframe_footer()
#7 {main}
thrown
I checked the website and used the plugin on a post and everything seems fine, no issues found, but the fatal error message still worries me.
Should I roll back as you suggest?: (Thank you to updating Post Snippets v 4.0, we have recoded the entire plugin please check your all snippets if there is any issue you can download the previous version from here).
Thanks for your help!
Regards,