Quick Post
Version 1.2
If you downloaded the plugin and it’s not showing up, it’s because you downloaded the plugin where I had left
display: none in the CSS. WHOOPS! If you download it now, it should work as described below.Quick Post does not work with the most recent versions of WordPress due to a change in how the post.php page functions. It now checks that the request is coming from an admin page. I’m looking at potential solutions and can hopefully come up with something that works within the WP framework without requiring modifications of core files by users. Until such time as that’s taken care of, using Quick Post with WordPress 2+ may require you to modify wp-admin/post.php or the check_admin_referer() function.
Sorry for the inconvenience.
Quick Post is a one-function plugin to provide users with an unobtrusive and quickly accessible post-area anywhere on the blog (including the Admin area). Coupled with some JavaScript, this can be a collapsable entry well that hides out of the way until it is desired.
Version 1.0 posts to the default category. I plan to improve future versions to provide options to allow user selection of the category, or fixed, administrative (i.e. in the function call) selection of the category.
The plugin is theme-aware and looks for a CSS file named quickpost.css in the current theme. If it does not find one, it will fall back to the CSS file quickpost.css that is in the plugin directory.
Installation is simple:
- Download Quick Post and extract it
- Drag quickpost.php and quickpost.css into your plugins directory
- Activate the Quick Post plugin in the admin console
- Add the call
cjb_quickpost()where you would like the form to show up
That is the most trivial installation and setup. The plugin offers several parameters that may be passed, including the width of the post title field as well as the width and rows of the post text area.
API
Functions
(PHP) cjb_quickpost($titleSize = "20", $rows = "10", $cols = "100%", $selectCat = false)
(JavaScript) toggleCJBQuickPost()
CSS Elements
| Element | Description |
|---|---|
| #cjb_quickpost | Surrounding DIV, surrounds the whole plugin area |
| .cjb_quickpostfield | Fieldset class, surrounds the form inputs |
| .cjb_quickpost_title | The post title field |
| .cjb_quickpost_category | The post category menu |
| .cjb_quickpost_content | The post content field |
| .cjb_quickpost_submit | The submit button |
Additional Information
Customizing the quickpost.css file (either the default, or putting a customized version into your themes) provides a wealth of options, including precision adjustment of the sizes and display properties.
As an example, in a blog that I maintain, I’ve added Quick Post to the sidebar and included JavaScript that toggles the visibility. This makes it very easy for the authors to add quick posts without having to load the admin interface and returns them to the page where they made the post, rather than the admin interface again.
Please feel free to leave problems, suggestions and general feedback in the comments. I read and respond to them, and will respond via e-mail if the e-mail address provided is valid.
The screenshot below was produced with, basically, the code here:
<div id="sidebar">
...
<?php if(function_exists('cjb_quickpost')) { cjb_quickpost(); } ?>
...
</div>
In the screenshot, the link “Toggle Quick Post” is a link to the JavaScript toggleCJBQuickPost()

Version History
- 1.2: Check the ‘default_comment_status’ setting in WP2+ and try to play nicely with WordPress’s referer checking. Please let me know if you use this plugin in a WordPress 2+ install and it works without modifications.
- 1.1.2: Small modification that should improve the likelihood that the user will be returned from the page they came from when posting. I believe that it is compatible with both 1.5.x and 2.0
- 1.1.1: Hopefully improved the method that the plugin uses to return the user to the page from which they posted.
- 1.1: Added the option to display and select the category to which to post
- 1.0: Initial release
May 23rd, 2005 at 8:48 PM
Seems like a nifty thing, though I’m having trouble getting it to show up where I want it. I have the area where it should be in the sidebar, but it’s not appearing.
In the sidebar, I am calling it like this: . (Small caveat there: you really should show it surrounded by the php stuff - took me a few to figure out why it looked different….) I have uploaded both files and activated the plugin. I have tried the call both with and without the variable parameters included (if the variables are necessary, you might consider adding an instruction to that effect). I have uncommented the commented section, which didn’t work for obvious reasons. The permissions are the same as other plugins I use.
What am I missing? I’m sure it’s something…. simple….
May 23rd, 2005 at 8:57 PM
Hmm. When I view source, this is what shows:
`
var showCJBQuickPost = false;`
`function toggleCJBQuickPost()
{
if(showCJBQuickPost == false)
{
showCJBQuickPost = true;
document.getElementById(’cjb_quickpost’).style.display = ‘block’;
}
else
{
showCJBQuickPost = false;
document.getElementById(’cjb_quickpost’).style.display = ‘none’;
}
}
`
May 23rd, 2005 at 8:58 PM
Well, anyway - can the backticks, and surround that whole thing with the script tags….
May 23rd, 2005 at 11:15 PM
Here’s how it should be called:
<div =”sidebar” >
<?php cjb_quickpost(); ?>
</div>
That’s it, the rest should take care of itself. You would end up needing to tweak the CSS, perhaps, but the only code you should have to touch is the cjb_quickpost() call.
The javascript that you quoted is automatically added to the header and won’t do anything unless you create some element that calls it.
May 23rd, 2005 at 11:36 PM
That’s exactly what I’m using. It just didn’t show in the post (due no doubt to the fact that I’m a space cadet and didn’t enter the code properly!) though it’s within li tags, due to the theme sidebar setup (and I just tried moving it out of the li tags, to first above the sidebar lists, then below them with no change). Anyway, I’m not seeing output of any kind, no toggle line - just a space where I have the plugin call inserted.
I’ve checked in FF, Opera, and IE. I’m not seeing anything. I’m also not getting any errors.
May 23rd, 2005 at 11:36 PM
I found, and fixed, the problem. Sorry, I accidently left something in the default CSS that shouldn’t have been there.
Open the quickpost.css file and make the following changes:
Delete
display:none;Change
color: whitetocolor: blackYou can modify the CSS, or if you use themes, modify the theme’s CSS, to have the
display: noneagain if you want to use the JavaScript calls to hide and unhide it. That got left in there from testing that feature, whoops!May 23rd, 2005 at 11:38 PM
Ah ha. I just reloaded the page after my above post, and saw your bug fix header. That should do it! And I see I have an email from you as well.
Thanks for the promptitude. I believe I’ll just edit the file - should be good to go!
May 23rd, 2005 at 11:42 PM
Heh, I had my own “WTF?” moment when I dropped it into another blog and it wasn’t showing up. Then I smacked my forehead at my own stupidity
May 24th, 2005 at 12:01 AM
One other thing, you’re missing the second closing parenthesis in the if statement above. Otherwise, we are now all systems green, and I thank you very much for something I didn’t know I needed until you gave it to me!
Looking forward to what else you might come up with….
May 24th, 2005 at 12:09 AM
Thanks
I’m glad that it’s something that you’re finding useful (bumpy start and all). I’m planning on adding some other features, such as optional category selection, but I don’t want to clutter it. After all, it’s supposed to be simple.
You might want to check out Dashboard Options. It’s my other WordPress plugin that adds a bunch of options for Admin Dashboard. It’s a heavier-weight plugin, but useful.
And thanks for pointing out that other typo. You’d think, given how often I did that over the past few days, that it wouldn’t be something I’d do again.
sigh It’s time for sleep
June 2nd, 2005 at 10:34 PM
Hi Chris. I really like this plugin and it works great except that when the post is submitted, it redirects me to the admin panel and says “post saved.” I want it to redirect back to the page where the user filled out the form. I’ve tried a couple of things but can’t get it to work. Thanks for your help.
June 3rd, 2005 at 7:57 AM
Hi Aja,
I think I figured out a better way to get the plugin to return you to where you to the page from which you came. Go ahead and download the plugin again and see if that fixes the problem.
June 5th, 2005 at 4:01 PM
Hi. I downloaded the new file but it is still redirecting me to the admin/post.php page instead of the page that the quick post form is on. I tried messing with it a little but I couldn’t get anything besides errors. Thanks for your help, though.
June 20th, 2005 at 10:44 AM
My G_d you are a genius. This is exactly what we needed. Thank you. I’m using the sidebar quickpost.
June 20th, 2005 at 11:22 AM
Aja, my initial thought had been that your browser wasn’t sending the HTTP_REFERER info, so I came up with a method that doesn’t use that information to determine where to go back to. So I’m not sure what would be stopping it from working. Does it do the same thing from all browsers or just one or…?
June 20th, 2005 at 11:22 AM
macewan, I’m glad you find it useful
June 21st, 2005 at 11:29 PM
does the quick post allow us to post to a specific category ? or only in the main page
June 22nd, 2005 at 8:03 AM
Yes, it’s not as well indicated as it should be (it really only appears in the Version History and the API notes), but version 1.1 added the option of selecting the category.
October 17th, 2005 at 7:22 PM
Hey Chris,
]
I’ve checked all the CSS and stuff on the plugin, activated it, and it still shows up blank at my site.
Login using www.teentec.net/wp-admin/ and go back to the site.
Login Details:
[edit: snip to protect the innocent
You have level 1 user
Please see what is wrong with it…thank you!
October 17th, 2005 at 7:38 PM
Sorry. Kill that first comment.
Now, it’s kind of way too wide.
Help, email me at shuai@teentec.net
Thanks!
Shuai
November 25th, 2005 at 7:33 PM
Hi.
Great plugin! But I hope you can help me with this problem:
I’m able to call the plugin where I want, but I don’t know how to tweak it (I’m a newbie). What I want to do, is to show the categories and some fields from the advanced editing menu (which are placed under the post form in admin cp panel). Is that possible? I know that the categories are possible, but what about the advanced editing tools? I’m using the EventCalendar (http://blog.firetree.net/2005/07/18/eventcalendar-30/), and I want to be able to edit the timestamp (which I need to do when I use the event calendar) with the quick post plugin.
It would be great if you could tell me how to show the categories, and if possible, fields from the advanced editing menu, with the quick post plugin.
Thanks.
J?ɬ?rgen
November 25th, 2005 at 10:29 PM
I’ve managed to get the categories now, but I don’t know how to get the “edit timestamp” field. I only want that field. I Really hope this is possible
November 26th, 2005 at 12:30 AM
Hiya Chris: still green as grass on all my 1.5.2 blogs, and works fine on the 2.0 beta 2 one as well - but that one is exhibiting the behavior noted above by “Aja”, where the post is made but you wind up on the admin post saved display. I thought this was specific to 2.0 beta until I read Aja’s posts….
December 5th, 2005 at 10:56 PM
Thanks very much, I am using your quickpost at my site, works well. It’s really needed since this site is for a gaming guild,
and all officers are allowed to post but some aren’t handy at blogging.
Did you know that in your leave a reply form here, the text box in the screen has no margin?
December 29th, 2005 at 2:33 AM
Great plugin!. Thanks you very much!
Still i?Ǭ¥m having trouble with users on level 1. When they try to post they get a message “You cannot post as this user.” Any idea?
Thanks again!
Rb
February 12th, 2006 at 4:06 PM
Hi Chris -
Just grabbed your latest version, but it’s still not working with a fresh install of wp 2.0. Seems to be borking on the user_level function (didn’t have a problem with the upgraded installs, just this fresh one). I’ve tried other calls ($user_id, $user_meta_id, etc.) none of which work. Any thoughts?
February 22nd, 2006 at 4:55 PM
I cant get the categorys to show , any idea why ? i tried modifying the plugin to category=true thing but still no show .
Please help .
February 22nd, 2006 at 5:16 PM
Ok , I managed to get the plugin to show , I modded it to use Checkbox’s so i can have multipale selections but even when i select a couple of categorys it sends to the default one . Am i missing something ?
February 22nd, 2006 at 5:22 PM
I did it ! , Here is the mod for multipale checkbox’s category selection :
Quick Post Cat
cat_ID == $cjb_defaultcat)
{
$cjb_select = ” checked”;
}
echo ”
cat_ID\”$cjb_select>
$cjb_acat->cat_name\n”;
}
?>
February 22nd, 2006 at 5:24 PM
admin , the code got cut off
here is a link :
http://www.i4geevu.com/quickpost.phpdd
February 22nd, 2006 at 5:53 PM
Having trouble with the userlevel also
February 25th, 2006 at 5:10 PM
Anyone got a userlevel 1 issue solved already??
March 2nd, 2006 at 4:17 PM
Hi Chris -
Have you had any thoughts about why it borks the whole thing in 2.0+? I really need it to work….
March 2nd, 2006 at 4:41 PM
Me again, Chris. Actually, I just figured out that it’s to do with the js for the current user info. That’s a PITA, and I’m going to have to see what I can figure out about it - I want that available only to me, not to anyone else….
March 2nd, 2006 at 4:51 PM
And once I figured THAT out, the fix is very simple: I changed this
“<?php global $user_level; get_currentuserinfo(); if($user_level &rt; 1 && function_exists(’cjb_quickpost’)) { ?&rt;”
to this
“<?php global $user_level; get_currentuserinfo(); if($user_id = 1 && function_exists(’cjb_quickpost’)) { ?&rt;”
[and I hope that makes the code display…. if it doesn’t: replace user_level with user_id and the numeral 1 with the user’s id number from the Authors and Users page….]
March 13th, 2006 at 6:13 PM
Oh gosh, you will be SO tired of me! Now that 2.0.2 is out, I upgraded some 2.0.1 and 1.5.2 installations, so now whenever I try to use QuickPost, I get “Sorry, you need to enable sending referrers for this feature to work.”
I’ve followed all the “fixes” for the sending referrers thing. None of them help. I’m not using ANY of the norton crap; I use FF and Zone Alarm. This is a sudden thing with the upgrades…. any thoughts?
March 19th, 2006 at 3:00 PM
Hi vkaryl,
As far as I know that’s a security setting on your side. Have you checked to see if your Zone Alarm and/or FireFox settings are stopping the referral from being sent? Your anti-virus software could be doing it, too.
March 29th, 2006 at 11:26 AM
Hi. I just upgraded to WP 2.01 and I’m having the same problem a few others mentioned. Whenever anyone other than the admin tries to use quick post, they get a “You cannot post as this user” message. Any ideas as to why this might happen? Thanks for all your hard work. I really appreciate it!
March 29th, 2006 at 11:51 AM
Well, I ended up just deleting all of the lines that called the user level, since I didn’t need those anyway, and now it works fine.
April 11th, 2006 at 1:45 PM
I know this question was asked earlier, but I would love to have EDIT TIMESTAMP as an option. Is this a possible add? I’m trying to have it so registered users can add an event to the calendar as mentioned earlier at http://blog.firetree.net/2005/07/18/eventcalendar-30/. I’m also having trouble with the toggle–can’t seem to get it to work.
April 11th, 2006 at 8:16 PM
I just upgraded recently to WP2 (and WP2.0.2) and have run into the “Enable Referrers” thing. The problem is that WP has implemented a feature to check the referrer of the incoming message post. And it checks that its from host/site-root/wp-admin, not just that it’s coming from the host (or host+root) of the blog.
Also, they do the check and then call plugin functions. Since the plugins functions are called after, I can’t simply add a function to say “oh, this particular setup is ok” or something.
One easy solution is to simply axe the referrer check in wp-admin/post.php. That might not be great security-wise, but it is definitely simple.
Unfortunately I don’t have a solution that works within the current WP framework. I’m looking at adding something like check_site_referer() or something, but that would still be a modification of what’s there rather than working within what they have already. I may check in with the WP devs and see what can be done, but until then it’s Quick Post won’t work “as-is” with the latest version(s) of WP (I don’t know what version was last compatible, but I think it might have been 1.5).
May 19th, 2006 at 8:38 AM
If we remove the refferer check will it work?
May 20th, 2006 at 1:11 PM
Hi Balistic,
Yes, removing that check will make it work. I’m pretty sure its there as a security/spam protection type of addition, but there are certainly times when it gets in the way (like, say, if you want to be able to “post” from something outside of the admin page).
You can also do what I did, and alter the spot where it checks the referer (mis-spelling intentional, since that’s the way it appears in the RFC and in the code) to have it just check that it’s coming from your host.
June 6th, 2006 at 3:01 PM
Hi Cris,
your plugin would be very helpful … but I cannot get it up and running.
1) Just downloades files, installed and activated in plugin-area (WP 2.0.3)
2) I would like to show it here (not sidebar) http://www.mabera.de/praktikertreff/ich-habe-da-mal-eine-frage/
-> see your comment 23.05.05
3) In wp-admin/post.php I searched for “referer” and put “//” at the beginning of each line.
What did I wrong?
Looking foreward for your help …
Thanks + yours
Volker
June 6th, 2006 at 9:12 PM
Hi Volker,
I’ve sent you an e-mail, but I’ll post here as well.
In post.php you only need to comment out the check_admin_referer here:
switch($action) {case ‘post’:
Did you edit your theme to include the PHP call
<?php cjb_quickpost() ?>You’ll have to put that somewhere in order for it to show the post form. Unfortunately there’s no way for me to simply “inject” the form where any particular person or theme would want it to go, so it’s a matter of locating the spot on your page that you want it to show up and add the call to the function.
June 7th, 2006 at 5:44 PM
Hi Chris,
thanks for your help. It’s now on my site.
But there is an other problem:
1) I would like to place it in a post. But in posts php normaly does not work.
2) So I use this plugin http://www.soeren-weber.net/post/2005/08/18/50/
3) Now your plugin is runing in posts. But your style-sheet is not working … I belief
Pls do me a favour:
- login to my blog on www.praktikertreff.de
- name = test
- code = test
- then go to http://www.mabera.de/praktikertreff/ich-habe-da-mal-eine-frage/
There you see the problem:
My side is of 3 columns, your plugin should be in column 2
-> normal look as www.praktikertreff.de
I would be great if you could help again.
Yours
Volker
June 7th, 2006 at 6:06 PM
Hi Volker,
I’d suggest tweaking the quickpost.css. If you’d like, you should be able to take the quickpost.css file, copy it to your theme directory (wp-content/themes/your_theme_name). QuickPost should use the css file from the theme directory if it exists.
Take a look at the
#cjb_quickpost textareastyle; it sets the width to 100% and it’s being mis-rendered in that particular block on your page. You could also delete that and call the plugin like so<?php cjb_quickpost("30", "10", "80"); ?>That would make a post form with a title field 30 characters wide and a subject area that was 10 rows high and 80 characters wide.
June 8th, 2006 at 4:08 AM
Hi Chris,
thankyou for your precise answere.
Last question: There is an hugh margin of lets say 100px before the headline. This margin is not specified in css.
How can I alter it?
Yours
Volker
June 8th, 2006 at 7:50 AM
Volker,
Without being able to see that particular page any longer, its hard to say. I’d take a look at the source of the page and see what the layout looks like around it.
If you’ve got Firefox with the developer tools installed, the DOM Inspector might be pretty useful. Another technique I often use - on a test or not live site - is to add a
div { border: solid 1px red; }style definition to either the header.php or the theme’s style.css. It won’t highlight every HTML element on the page, but it will give you an idea of where to start looking. It can also help determine if your layout is doing what you expect.If you use tables for your layout rather than (or in addition to) CSS, you might want to also check the tables by adding a similar style definition for tables.
Remember, though, that if you do that testing on a site that people are using that they’ll see those things too
June 8th, 2006 at 4:08 PM
Hi Chris,
thanks for your answer … but I cannot see the direction to go.
You might like to register yourself on my site.
To find “the page” simple click on the orange dot with ? on it.
www.praktikertreff.de
Sorry to bother you.
Yours
Volker
June 11th, 2006 at 6:20 PM
Hi Volker,
I’m on vacation currently, but if you’re still having trouble when I get back next week we’ll see what we can work out.
June 19th, 2006 at 1:50 PM
Thanks …
July 13th, 2006 at 2:45 PM
Is there a way to make it default to allow comments on the post it creates? I just installed it, and it works, but it automatically sets it so comments are off.
August 4th, 2006 at 10:35 PM
Your quickpost plug-in sounds like exactly what I need… but it doesn’t seem to work with WP 2.0.4. I commented out the check_admin_referer line, and it’s showing up and everything… but it doesn’t actually post the content.
August 8th, 2006 at 7:18 AM
Hi Tom,
I haven’t upgraded to 2.0.4 as of yet, but I wouldn’t be surprised. Every WP upgrade seems to break the QuickPost plugin. It’s terribly annoying
I’ll take a look when I get around to installing WP 2.0.4 because QP is the only way I end up posting, but that probably won’t be for a few days at least.
I’ll send you an e-mail when it works.
December 31st, 2006 at 11:56 AM
Hi, when i click active, it shows:
Warning: Cannot modify header information - headers already sent by (output started at /home/wodegong/public_html/guoshui9403/wp-content/plugins/quickpost.php:1) in /home/wodegong/public_html/guoshui9403/wp-includes/pluggable-functions.php on line 269
and when i want to write post, it shows:
Warning: Cannot modify header information - headers already sent by (output started at /home/wodegong/public_html/guoshui9403/wp-content/plugins/quickpost.php:1) in /home/wodegong/public_html/guoshui9403/wp-admin/inline-uploading.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at /home/wodegong/public_html/guoshui9403/wp-content/plugins/quickpost.php:1) in /home/wodegong/public_html/guoshui9403/wp-includes/pluggable-functions.php on line 269
Can you tell me what is wrong with this?
Thanks
Frank
January 3rd, 2007 at 12:04 PM
Your tool is great! I appreciate the work you did. As someone mentioned above, how do I get it so that posts do not automatically show up with Comments off?
Thanks in advance!
Scott
January 3rd, 2007 at 1:28 PM
Hi Scott,
It actually should be setting the comment status to whatever is set as the default for your blog (it should query the ‘default_comment_status’ option if you have WordPress 2.0 or higher). If it isn’t doing that, let me know what version of WordPress you’re using - perhaps they changed a variable name or something similar.
January 3rd, 2007 at 1:33 PM
Hi Frank,
I sent you an e-mail as well, but what version of WordPress are you using? I don’t know of anything off the top of my head that would cause it to malfunction like that.
January 3rd, 2007 at 1:38 PM
Scott,
Actually, that ‘default_comment_status’ is in an unreleased version (that I’m releasing right now!). Whoops
It should work better with at least some versions of 2.0, though I’m not sure right now if it still requires modifications to the core files (it’s been quite awhile since I upgraded my WordPress install).
March 22nd, 2007 at 2:17 AM
I’m not able to get this plugin to display to anyone other than an Admin or Editor account, even thought the other accounts have writing ability.
I also can only get this plugin to display in the sidebar, how can I get it to display in the main column as a separate page.
April 18th, 2007 at 6:10 AM
hi. good work there. but i wondered if i can use the quick post for editing a post. ie, in a pop-up window when i click on edit in a post.
April 18th, 2007 at 6:25 AM
Hi acidelia, thanks for the feedback. That’s a good idea for some additional functionality in Quick Post. As it is, no you can’t do that, but if it’s something that I can easily add on then I’ll give it a shot. It might take a little while, but I’m definitely going to look at it.
April 18th, 2007 at 6:35 AM
in fact, there is a plug-in already, called edit N place. but it doesn’t work great, at least it has character encoding problem. but it may help you to add this functionality.
sorry for my inconvenient english.
April 25th, 2007 at 3:35 AM
Thank You
June 9th, 2007 at 9:30 PM
Any chance we can get some ajax juiciness working with the plugin?
June 17th, 2007 at 2:07 PM
I would really like to see some quicktag support as well… that would rock!
June 25th, 2007 at 10:20 AM
If anyone is interested, I followed Alex King’s tutorial on including HTML Quicktags into form areas. Would still like to see if it’s possible for the developer to work on some ajax support… for at least the last version of WP that it works on.