WordPress.org

Ready to get started?Download WordPress

Forums

Code Snippets
[resolved] Order Snippets (6 posts)

  1. WiSch
    Member
    Posted 1 year ago #

    Hi.
    Is it possible to order the snippets, so that I force on to be the first one?
    I want to use sessions and the code for activating it has to be the first in the functions.php
    So I'm looking for an option to sort the snippets and force the one for the sessions to be the first one.

    Thanks for your support and the great plugin.

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

  2. Shea Bunge
    Member
    Plugin Author

    Posted 1 year ago #

    Snippets are executed in the order they appear in the database. So you can login through phpMyAdmin or similar, and reorder them there. Try messing around with the IDs of the snippets.

    If you're not happy delving into the database, export your snippets as an XML file, and edit that, reordering the <snippet> sections. Then delete your snippets and re-import them.

  3. WiSch
    Member
    Posted 1 year ago #

    Wow, that was a fast reply!
    OK, I saw the IDs in the Database an will try that.
    Maybe you'll include a function to order the snippets in a future version of the plugin, could also be usefull only to sort for organization or something like that.
    Thanks for your support.

  4. Shea Bunge
    Member
    Plugin Author

    Posted 1 year ago #

    As in, a UI for manually re-ordering snippets, or a filter that you can use in a custom plugin?

  5. WiSch
    Member
    Posted 1 year ago #

    I think about an UI to manually re-order the snippets. Some drag'n'drop to re-order and save the new sorting.

  6. Shea Bunge
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm… maybe as another addon plugin. Thanks for the suggestion

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.