WordPress.org

Ready to get started?Download WordPress

Forums

Code Snippets
[resolved] Activation/Deactivation of Snippets (6 posts)

  1. Arnegger
    Member
    Posted 1 year ago #

    Hey, your plugin seem to be of great value - just what I was looking for. I especially like the import/export option. One question though:

    There is the possibility to activate/deactivate snippets. Do activated snippets cost server performance? Or whatfor is the possibility to deactivate?

    Another question: I saw some great snippets in your screenshot. Is there a possibility to look at these snippets as for learing of the possibilities of this plugin? Where can I find these snippets?

    Is there also the possibility to enter maybe a dropdown list as a selection of the activated snippets to the editor in order to empower users to simply enter the snippets into posts and pages?

    PS: You documentation link seem not to work - maybe there would have been less questions, if I could have read this. So far your plugin looks great. Thank you.

    Looking forward to your answer,
    Arnegger

    http://wordpress.org/extend/plugins/code-snippets/

  2. Shea Bunge
    Member
    Plugin Author

    Posted 1 year ago #

    Activating a snippet is just like you have pasted the code into your functions.php file. Deactivated snippets function just the same as activated snippets, only one major factor: the code is not executed. Both deactivated and activated snippets are stored in your database. The only difference that activated snippets are actually run on your site as if they were in a plugin or in your functions.php file.

    As for the snippets seen in the screenshot, when I release the next major version of Code Snippets (planned for sometime after WordPress 3.5 is released), I'll also release an export file on the website. This export file will contain some sample snippets that you can download and import into your collection.

    The main purpose of this plugin is executing PHP code snippets on your WordPress site as if they were pasted in your active theme's functions.php - not for displaying snippet code on your site. There are plenty of other plugins around that will let you do the later. I suppose that it may be possible to expand this plugin to include displaying of snippets, but that is not what it is for. At the moment there are plenty of other features to add into Code Snippets.

    I'm sorry about the documentation website being down - I've been having problems with my web host lately, and the website has been dropping in and out. I'll be moving to much reliable web host on the weekend - I'll let you know here when the switch has been made.

  3. Arnegger
    Member
    Posted 1 year ago #

    Thank you so much for your update. Great.
    About your third paragraph regarding displaying snippet code there must have been some miss understanding. I am not interested in that at all. What I meant was the possibility to have a dropdownlist within the editor, so I could easily pick a code snippet and it gets inserted into the post automatically (by choosing from the dropdownlist). THX so much!
    Great - your site is also up again. :-)

  4. Shea Bunge
    Member
    Plugin Author

    Posted 1 year ago #

    The same applies to inserting code into your posts as displaying code on your site: snippets are composed of PHP code that will be executed on your site - not HTML or text. Any snippet that you could paste straight into your functions.php file could be used with this plugin.

  5. Arnegger
    Member
    Posted 1 year ago #

    Hi and thank you for your answer: I am aware of that. I have used other Plugins before to enter PHP-Code in posts/pages such as "PHP Execution" in example. BUT: Within PHP Execution you enter the PHP-Code directly into the post/pages HTML Tab in the editor. Now this is exactly my question: It appears to me (what I like) that with your plugin I may manage snippets and add new snippets in the manage snippets area. BUT: After adding new snippets: HOW DO THESE SNIPPETS COME INTO THE POST OR PAGE?

    Do you understand? This is my question. How do I get this code into the post. I would guess via [shortcode] ??? Or how is this entered? If I would enter it the regular way: Just putting the plain PHP Code (just like with "PHP Execution") into the posts editor? I do not get it...

    So please be so kind and answer this question of mine, so I may learn how to put the php snippet into the post editor. Thank you.

    Regards, Arnegger

  6. Shea Bunge
    Member
    Plugin Author

    Posted 1 year ago #

    As yourself put it in this thread:

    The snippets will be automatically included into the functions.php file.
    They are actually not to be included into the text editor in a post or page at all.

    Technically, they're not actually in your functions.php file, but it's just as if they were. I hope you still enjoy using my plugin. :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.