• On a future iteration, would it be possible to make the list of snippets able to be reordered and thereby affect their order of execution, much as it happens if they were in a functions.php file?

    Oh, and while you’re at it, could you make it so that the snippet numbers reflect their order and a deleted snippet, and therefore a missing number, can be replaced?

    https://wordpress.org/plugins/code-snippets/

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

    (@bungeshea)

    Support for snippet reordering is a fantastic idea. It has been suggested to use something similar to the Simple Page Ordering plugin as an interface for reordering snippets, and I am definitely planning to introduce this feature in a future version.

    The snippet numbers (IDs) are managed by MySQL and are an essential part of the snippet database table. MySQL has control over how the numbers are assigned, and if missing numbers are replaced. It might be possible to put together a workaround, but this would probably mean bypassing the built-in WordPress functions and would not be the most compatible solution.

    Thread Starter Terence Milbourn

    (@pubdirltd)

    Looking forward to seeing it. But then comes the question, what (if anything) will you build in to help with setting the correct order?

    Plugin Author Shea Bunge

    (@bungeshea)

    Hopefully I can make it so snippets can be reordered using drag-and-drop. See this plugin for an example. Then the snippet order would probably be saved in a database option as an array keyed by the snippet ID, which then would be used as an order to display and execute snippets.

    Thread Starter Terence Milbourn

    (@pubdirltd)

    Sounds like a plan. Then you could arrange the order much as you could when you put the snippet into you functions.php.

    Excellent.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feature request: Order of execution’ is closed to new replies.