Support » Plugin: Code Snippets » Great plugin – Two suggestions:

  • Fantastic plugin, does exactly what it promises, allowing to manage all the custom code – CSS, JS, PHP – in one neat place.

    1. Please add revisions for the snippets: since those are just a custom post category, why not inherit the “revisions” feature, allowing to track past changes and revert to a previous version, if needed.
    2. Would be cool to also have “rules” of where to use a specific snippet – similar to how it’s implemented in the “Custom CSS & JS” plugin. You can define that a specific snippet can only be active on a specific page (not just admin/front) – pretty useful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shea Bunge


    1. Snippets are actually not stored as a custom post type, which is why revisions are not currently built-in. I could build this feature for myself, or switch them to being stored as custom post types, but my concern is that this could impact the performance. It’s something I will definitely keep in mind during future development.

    2. That does sound like a useful feature – it’s something I will also keep in mind. My hesitation to add such interface controls is that you already have pretty powerful options for controlling where snippets are run simply by adding an if statement to the beginning of the snippet code, e.g. if ( is_page( 'contact' ) ) return;, and I don’t feel like there would be any performance benefit to adding in a more restrictive method of doing this. I will definitely keep it in mind though.

    Thank you for the review!

    I have the following code at the beginning of the snippet:
    if ( !is_page( ‘what-we-do’ ) ) return;
    so theoretically the snippet should only load on the what-we-do page but it doesn’t work, the code doesn’t run on any page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Great plugin – Two suggestions:’ is closed to new replies.