Insert an image into a WordPress Post with a plugin.
So in a project I’m working on I need to use a normal form to insert a post into the database. My client wanted the form to also add an image to the post. Furthermore, the image must be inserted using normal WordPress methods. The code below is the minimum required to insert an image into the database and attach it to a specific post.
include_once(ABSPATH.'/wp-admin/includes/media.php');include_once(ABSPATH.'/wp-admin/includes/file.php');include_once(ABSPATH.'/wp-admin/includes/image.php');// $id is the id of the post being inserted// $name is actually the name of the form input that uploaded the file so WP can access it using $_FILE[$name]media_handle_upload($name,$id);
If you are inserting a new post, it makes sense to have the line $id = wp_insert_post($post_data); before this.
Wordpress Dashboard Editor
Of the entire website the Dashboard is seen by administrators the most, but it is the hardest part of Wordpress to customize. Well not anymore. This plugin allows you to add whatever you want to the Dashboard through PHP and HTML and allows you to even add Sidebar Widgets. You may also wipe the entire dashboard or individually remove some of the more irritating sections like the Dev news, Planet Wordpress and the getting started section.
In WordPress 2.5, the code is cleaner, the plugin is more responsive and you can add both “real” sidebar widgets, or add “fake” ones to match the dashboard.
This plugin is currently intended for 2.5, but it also works in Wordpress 2.1 – 2.3 and can work in Wordpress 2.0.x if you use the Completely Wipe Dashboard option.
Linkage brought to you by: "A friday in my newsreader: Febuary 22." Also by the letter 'A'.
Occasionally, so many wonderful posts appear in the lull between the Thursday doldrums and the Friday excitation (pun much?) that I have to “link it up…er…mott”.
- It turns out that you can see the effects of trawling for fish from space. Do we need any more evidence against it?
- Uncertain Principles posts about the backlash from the Virginia Tech shootings: turns out stage plays with fake wooden weapons endanger students…according to some college administrators.
- Uncertain principles also wonders if there is any realistic nanotechnology in SciFi writing.
- That encrypted hard drive you might have? Worthless now that the encryption can be broken…easily.
Oh and as a side note, anyone else watch one of my favorite video blogs: http://tv.winelibrary.com/?
image credit: Pulpolux !!!
Now that you have gotten used to WP 2.3 and had time to fiddle around with all those tags, you are probably finding that you need to edit, rename or delete tags. While I was going to write my own Plugins for this for a while, I found the perfect Plugins to do the work for me — and by perfect I mean really good, so I take no responsibility if they eat your dog.
The Simple Tags has been around for a long time, but now it works perfectly with Wordpress tagging. What does it do? Most everything you could want (I could retype the list, but I’m going to borrow it straight from the Simple Tags website):
- type-ahead input tags
- auto suggestion of tags
- tags management (rename, delete, amalgamate, search and add tags, edit tags ID)
- List of non tagged contents
- Edit mass tags
- Possibility to tag pages (not only posts) and include them inside the tags results
- Related content since common tags
- Possibility to add related posts inside RSS
- Dynamic Tag Clouds with colors with Widgets
- Tags inside your header’s blog
- Embedded tags ([tags]tag1, tag2[/tags]) for retro compatibility
I use a lot of Plugins and write a lot of Plugins, so the fact that I even use one usually means it is really well made or very useful, but this one is one of the very few that I thought was good enough to promote.
If you use INAP and have noticed oddness with your full-text feeds lately, it may have been caused by INAP. Users that had the “custom options” selected would have their feeds trimmed as if it were a post. INAP 2.4.3 fixes this.
In other news, INAP is in the process of a major overhaul including a complete rewrite of most of its antiquated structure. When this process is complete it will be rebranded to demonstrate the totality of its features (it won’t be called INAP anymore because the name is too restrictive), but will be released as version 3.0
Inline Ajax Page was listed on Mashable as one of “30 good [AJAX wordpress plugins].” While I’m thankful for the publicity (it seems half the internet is scraping Mashable’s feed which resulted in a huge Technorati boost), as always, it was described as “Allow[ing] readers to see a snippet of a post, click a button and the remainder will appear without going to another page.”
I almost cried. That description fits only the 1.0 version of INAP that was released over a year ago–now it does so much more than that that it is almost like saying Google is just a search engine. Oh well, the traffic generated was good quality.
In other news, version 2.4.25 was released a couple days ago to fix a bug that occurs when submitting a comment using the jQuery library under IE6.

