Title: [Plugin: Sniplets] New post bug
Last modified: August 19, 2016

---

# [Plugin: Sniplets] New post bug

 *  [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-sniplets-new-post-bug/)
 * Hello,
 * the JS file for this plugin is not loaded when writing a new post. That makes
   the sniplets meta box and also rest of the inline JS non-functional.
 * Please make sure to fix sniplets.php, line 150 from:
 * `if ( (isset($_GET['page']) && $_GET['page'] == 'sniplets.php') || strpos ($_SERVER['
   REQUEST_URI'], 'page.php') || strpos ($_SERVER['REQUEST_URI'], 'post.php')) {`
 * to:
 * `if ( (isset($_GET['page']) && $_GET['page'] == 'sniplets.php') || strpos ($_SERVER['
   REQUEST_URI'], 'page.php') || strpos ($_SERVER['REQUEST_URI'], 'post.php') ||
   strpos ($_SERVER['REQUEST_URI'], 'post-new.php')) {`
 * That adds check for _/wp-admin/post-new.php_ address and loads the required JS.
 * Plugin version: 1.4.4, 1.4.5.
 * Thanks,
    Martin

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [kabeza](https://wordpress.org/support/users/kabeza/)
 * (@kabeza)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-sniplets-new-post-bug/#post-1894955)
 * Hi FolioVision
    I was looking for the same. I was having trouble inserting images
   into new posts, because the lightbox never worked, etc.
 * I firebugged and discovered it was due to Sniplets.
 * I’m using the 1.4.5 version and fixed the bug in the following lines: 250 and
   258 (but nothing found at line #150)
 * Thanks for the fix!
 *  [9steps](https://wordpress.org/support/users/9steps/)
 * (@9steps)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-sniplets-new-post-bug/#post-1894959)
 * Hi,
 * I have the same problem on WP3.3 with Sniplets. I’ve tried the fix but does not
   work unfortunately.
 * I suppose that jQuery and jQuery UI update on WP3.3 make this problem happened.
   Anyone knows how to fix this?
 * Regards,
 *  [Martin Blumenfeld](https://wordpress.org/support/users/monkeypress/)
 * (@monkeypress)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-sniplets-new-post-bug/#post-1894960)
 * There are two fixes for this issue from what I’ve seen. One uses FolioVisions
   update as described above. WordPress changed the URL for new posts to “post-new.
   php”. So that’s one. Another change has to be made to the admin.js file in the
   resources folder of the Sniplets plugin.
 * If you replace lines 231 to 239 with these line it’ll get your edit page working.
   It won’t however add in the sniplets button to your toolbar. I’m not sure what
   button the original developers code is trying to clone. Then again we have a 
   new solution and won’t require sniplets in our next site release.
 *     ```
       if (but) {
       		while (but.nodeType != 1)
       			but = but.previousSibling;
   
       		but = but.cloneNode (true);
       		toolbar.appendChild(but);
       		but.value = 'sniplet';
       		but.title = edButtons.length - 1;
       		but.onclick = function () {edInsertTag(edCanvas, parseInt(this.title));}
       		but.id = "ed_sniplet";
               }
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Sniplets] New post bug’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/sniplets.svg)
 * [Sniplets](https://wordpress.org/plugins/sniplets/)
 * [Support Threads](https://wordpress.org/support/plugin/sniplets/)
 * [Active Topics](https://wordpress.org/support/plugin/sniplets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sniplets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sniplets/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [Martin Blumenfeld](https://wordpress.org/support/users/monkeypress/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-sniplets-new-post-bug/#post-1894960)
 * Status: not resolved