Jerome’s Keywords and WordPress 2.0

I was having some problems with my keywords getting deleted when updating a post (using Jerome’s Keywords 1.8). The problem was a result of a blank textarea on the page to edit a post. Wasn’t hard to fix at all.

The textarea, with a header of “Keywords”, shows up blank when editing a post. The initial post is good because that text area is filled out manually. jeromes-keywords.php was using “$postdata->ID” as a reference in the get_post_meta() function. $postdata->ID didn’t contain any value at all.

After doing a little digging, I found I could get a posts ID using $post->ID, notice the missing “data”. It only takes a few steps to get Jerome’s Keywords working 100% in WordPress 2.0.
1. Open wp-content/plugins/jeromes-keywords.php in a text editor.
2. On line 553, change the line that says “global $postdata, $content” to read “global $post, $content”.
3. On line 555, change “get_post_meta($postdata->ID, KEYWORDS_META, true)” to “get_post_meta($post->ID, KEYWORDS_META, true)”.
4. Save jeromes-keywords.php, you’re done.

After doing that, the keywords textarea created by the plugin will be populated with your original keywords. I guess that textarea must have the keywords there all the time, even when editing. Before, my keywords weren’t in the “keywords” textarea, they were only in a custom field.

It appears that Jerome’s Keywords deletes post meta every time that post is edited. And I think that’s the desired functionality for some reason. I only say that after looking at the code for a half hour or so. I think the post would end up with one custom field named “keywords” for every time the post is edited or updated. So, update a post 4 times and you’ll have 4 identical custom fields named “keywords”.

All of my favorite plugins are now working very well for me with WordPress 2.0-RC1.

0

Well, now what?

Work with Me

I'm available for hire and always taking new clients, big and small. Got a project or an idea you'd like to discuss? Startup plan but no developer to make it happen? Just get in touch, I'd love to see if I can help you out!

Leave some Feedback

Got a question or some updated information releavant to this post? Please, leave a comment! The comments are a great way to get help, I read them all and reply to nearly every comment. Let's talk. 😀

Longren.io is proudly hosted by DigitalOcean

DigitalOcean

6 thoughts on “Jerome’s Keywords and WordPress 2.0

  1. Thanks for this fix. I was having problems with the tags disappearing whenever I updated a post. Now the tags stay put! Now all I have to do is work out how to delete a custom field entry that refuses to budge!

    0

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.