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 \"\n<!--\naddLoadEvent(function(){jQuery('.edit-timestamp').click();});\n//-->\n\";"),50);
Hi Mark
Where to put this code?
Great idea!
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,
Try a browser that renders better…looks fine to me…
I’m using FF 2.0.0.16. The line of code extends way beyond my miserable 1024 by 768 screen.
That’s nothing … all of my plugins are one-liners:
perl -pe 's|\n||' plugin.php > plugin2.php
*scnr*
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)
Returns a syntax error for me.
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
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!
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.
And to be clear, this is just the “PHP payload” portion of the plugin. Here it is as a proper plugin.
Quick question before I try this:
Is it WordPress version dependent? (i.e., 2.5, 2.0.11, etc.?)
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
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)
@Brian Carnell
Did ya tried changing the ´ for ‘ quote?
@Brian Carnell
‘ stands for simple quotes… this form mess it all xD~
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.
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.
In PHP 5.3, it would be.
$javascript = function ($a) { echo ”
\n\n
“; };
add_action(‘admin_head’, $javascript, 50);
Wrap it using the sourcecode shortcode:
http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/
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.
Didn’t know about that sourcecode shortcode. Done!
Might be a good candidate for WordPress core.
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);
Returns a syntax error for me.
Dimana harus meletakkan kodenya
salam dari hattp://myrazano.com
terimakasih