WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#2533 closed enhancement (wontfix)

Click-down box for code snippets

Reported by: outchy Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.0.1
Component: Optimization Keywords: code, snippets
Focuses: Cc:

Description

It would be great to have a click-down box on the 'Write Post' page where you could create code snippets, save them and then be able to drag & drop them into the text editor. If you use a Mac, you can see exactly what I'm talking about by downloading and trying out Smultron.

So as an example, I could save the following code under the title 'Image Shadow':

<div class="img-left">
<img src="./images/image_01.jpg" alt="My house" /></div>
<br clear="all" />

Then, all I would have to do is click-down the Snippets box, drag the word 'Image Shadow' onto the text editor and the full code would appear. This would be tremendously handy.

Attachments (2)

wp-macros.php (2.6 KB) - added by technosailor 8 years ago.
wp-macros-functions.php (5.6 KB) - added by technosailor 8 years ago.

Download all attachments as: .zip

Change History (5)

technosailor8 years ago

comment:1 technosailor8 years ago

Two files added as plugin files. They are rough as I just did them today. But they should work for the most part. They could use some cleaning up love and the ability to delete said macros is not there. But is this what you are looking for?

Note that this plugin adds a dropdown populated with macro names and an option to add a new macro from the write page. It also adds it's own management page.

comment:2 markjaquith8 years ago

Really sounds like functionality that could be added with a plugin. Don't seem to be something that everyone would want, so it's well-suited for a plugin.

comment:3 davidhouse8 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Plugin.

Note: See TracTickets for help on using tickets.