One-line plugin of the day
Opens the post timestamp editing fields without you having to click the “Edit” link every time. Great for people who are always scheduling their posts.
add_action('admin_head',create_function('$a', "echo \"<script type='text/javascript'>\n<!--\naddLoadEvent(function(){jQuery('.edit-timestamp').click();});\n//-->\n</script>\";"),50);

Hi Mark
Where to put this code?
MuslimBlogger
July 30, 2008 at 1:49 pm
Great idea!
marilyn
July 30, 2008 at 1:58 pm
I’m aware you’re a premier WP guru, but this is not that helpful, Mark. It doesn’t concern you that the syntax extends through the sidebar, making it hard (but not impossible) to copy (or even read) the line?
Speaking of plugins, there are plugins to handle this problem that occurs with long HTML fragments, which won’t wrap like text. You may want to look into one of them.
Regards,
HAID
Haid Dasalami
July 30, 2008 at 1:59 pm
HAID,
Try a browser that renders better…looks fine to me…
klitscher
July 30, 2008 at 2:21 pm
I’m using FF 2.0.0.16. The line of code extends way beyond my miserable 1024 by 768 screen.
JJ
July 30, 2008 at 2:24 pm
That’s nothing … all of my plugins are one-liners:
perl -pe 's|\n||' plugin.php > plugin2.php*scnr*
Alex
July 30, 2008 at 2:31 pm
jQuery is smarter than you give it credit for.
The line:
if (jQuery(’.edit-timestamp’)) { jQuery(’.edit-timestamp’).click(); }
is redundant; empty jQuery objects don’t throw errors if you use them, they just do nothing. So all you need is:
jQuery(’.edit-timestamp’).click();
(And putting some spaces in may help it wrap away from the sidebar)
Danny Wachsstock
July 30, 2008 at 3:59 pm
Returns a syntax error for me.
Brian Carnell
July 30, 2008 at 4:02 pm
[...] Mark on WordPress, publicaba un ejemplo de plugin de una sola línea, con el que hacemos que el panel de planificación de publicación aparezca desplegado por [...]
Crea plugins para Wordpress en una sola línea | aNieto2K
July 30, 2008 at 5:05 pm
klitsch,
Hadn’t thought of that. I’m just used to presuming everything renders better in FireFox. Turns out, IE7 wraps the text to fit the content area. Who’da thunk it?
So, by “better browser,” do you mean IE7?
LOL. That’s a new one.
Regards,
HAID
Haid Dasalami
July 30, 2008 at 6:34 pm
Ouch: I’m just out of a scheduling-intense week and I would have used this a lot… too late now
Thanks anyway for sharing!
UncleZeiv
July 30, 2008 at 7:14 pm
Haid,
I use Safari for my day-to-day browsing (but Firefox for development). Looks fine in Safari. In any case, I inserted manual line breaks to fix it up.
Danny,
Nice! jQuery continues to amaze me. I’ve updated to remove that conditional wrapper. That’s good to know.
Mark Jaquith
July 30, 2008 at 9:17 pm
And to be clear, this is just the “PHP payload” portion of the plugin. Here it is as a proper plugin.
Mark Jaquith
July 30, 2008 at 9:20 pm
Quick question before I try this:
Is it WordPress version dependent? (i.e., 2.5, 2.0.11, etc.?)
Perry
July 30, 2008 at 11:03 pm
Thanks but can you tell me why its not working on firefox though i tired with safari and it works well. still I am stumbling it here http://lindsayhogan.stumbleupon.com/ for all my SEO group at stumbleupon
Lindsay Hogan
July 31, 2008 at 3:17 am
Loving the one-line plugin… any more gems?
Just a thought about the source-code in your post, why not use the [sourcecode] short code?
(I like the the “copy to clipboard” quick link it has)
Lee Kelleher
July 31, 2008 at 4:41 am
@Brian Carnell
Did ya tried changing the ´ for ‘ quote?
gOk
July 31, 2008 at 8:24 am
@Brian Carnell
‘ stands for simple quotes… this form mess it all xD~
gOk
July 31, 2008 at 8:25 am
[...] Jaquith solves that problem with a one-line plugin that keeps the timestamp field open [...]
Brian.Carnell.Com » Blog Archive » Timestamp Plugin for WordPress
July 31, 2008 at 10:55 am
There is a problem just clicking the edit time link? I schedule ALL of my posts, and I don’t have any problem just clicking the link.
djallyn
July 31, 2008 at 1:49 pm
If you add this to the functions.php file in a theme, will that make this work? Seems like the perfect added functionality to slip quietly into a theme to me.
Network Geek
July 31, 2008 at 2:32 pm
In PHP 5.3, it would be.
$javascript = function ($a) { echo ”
\n\n
“; };
add_action(’admin_head’, $javascript, 50);
Jacob Santos
August 1, 2008 at 11:09 am
Wrap it using the sourcecode shortcode:
http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/
Matt
August 2, 2008 at 12:45 am
Haid,
Hmm…I was in FF3, so by better browser I definitely didn’t mean IE. I must have caught it after the code was edited. Regardless, it looks nice now.
klitscher
August 2, 2008 at 10:19 am
[...] Mark on WordPress, publicaba un ejemplo de plugin de una sola línea, con el que hacemos que el panel de planificación de publicación aparezca desplegado por [...]
Catédra » Crea plugins para Wordpress en una sola línea
August 4, 2008 at 4:37 am
Didn’t know about that sourcecode shortcode. Done!
Might be a good candidate for WordPress core.
Mark Jaquith
August 6, 2008 at 12:44 am
You may as well let jQuery handle the DOM load event itself, as it makes the code a little shorter.
add_action('admin_head',create_function('$a', "echo \"jQuery(function(j){j('.edit-timestamp').click();});\";"),50);Austin
August 6, 2008 at 8:00 am
Returns a syntax error for me.
serfman
August 18, 2008 at 5:39 pm
Dimana harus meletakkan kodenya
salam dari hattp://myrazano.com
terimakasih
myrazano
January 11, 2009 at 12:00 pm