Permalink
Browse files

Small fix to make the image fields work in WordPress 3.3.1

  • Loading branch information...
1 parent 09e996f commit f745e875580f845017c3392519cb75283ec60c95 @randyhoyt committed Feb 21, 2012
Showing with 68 additions and 12 deletions.
  1. +5 −0 README
  2. +49 −0 js/wp-category-meta-scripts.js
  3. +6 −4 readme.txt
  4. +8 −8 wp-category-meta.php
View
5 README
@@ -0,0 +1,5 @@
+#Category Meta plugin
+
+This plugin has been forked from the broken version in the WordPress repository: [http://wordpress.org/extend/plugins/wp-category-meta/].
+
+This plugin adds meta data to the wordpress categories and terms. It creates a wp-termsmeta table to store the entered meta. It adds input fields to the category and other term administration interface to enter the meta values. It provides functions to retrive / create / update / delete the category and terms meta. It can be used to add meta to custom taxonomies (terms).
@@ -38,3 +38,52 @@ function remove_image_url($field, $message){
jQuery('#' + $field).val('');
jQuery(image_display_id).html('');
}
+
+//Extracted from fpg_scripts.js (Flash Picture Gallery Plugin) and modified for use here.
+function image_url_sync(){
+ add_image_url = '';
+ add_image_url = image_url_collection;
+ view_image_url = "<img src=\"" + add_image_url + "\" width=\"200px\" />";
+
+ if (add_image_url == '') add_image_url = 'No images selected';
+ field = '';
+ field = jQuery("#image_field").val();
+
+ url_display_id = '#' + field + '_url_display';
+ image_display_id = '#' + field + '_selected_image';
+
+ jQuery(url_display_id).html(add_image_url);
+ jQuery('#' + field).val(add_image_url);
+ jQuery(image_display_id).html(view_image_url);
+ jQuery("#image_field").val('');
+
+}
+
+function image_url_add(){
+ image_url = edCanvas.value.match(/img src=\"(.*?)\"/g)[0].split(/img src=\"(.*?)\"/g)[1];
+ image_url = image_url.replace(/-[0-9][0-9][0-9]x[0-9][0-9][0-9]\./i,'.');
+ image_url_collection = image_url;
+ edCanvas.value = '';
+ image_url_sync();
+}
+
+function image_photo_url_add($field){
+ jQuery("#image_field").val($field);
+}
+
+function remove_image_url($field, $message){
+ url_display_id = '#' + $field + '_url_display';
+ image_display_id = '#' + $field + '_selected_image';
+
+ jQuery(url_display_id).html($message);
+ jQuery('#' + $field).val('');
+ jQuery(image_display_id).html('');
+}
+
+jQuery(document).ready(function ($) {
+ window.send_to_editor = function (html) {
+ tb_remove();
+ edCanvas.value = html;
+ image_url_add();
+ }
+});
View
@@ -1,10 +1,10 @@
=== Category Meta plugin ===
-Contributors: Eric Le Bail, Tom Ransom
+Contributors: Randy Hoyt, Eric Le Bail, Tom Ransom
Donate link: #
Tags: category,meta,category meta,admin,plugin,image,icon,images,icons,category icon,category image,taxonomy metadata,taxonomy meta,custom taxonomy meta
Requires at least: 2.8
-Tested up to: 3.0
-Stable tag: 1.2.4
+Tested up to: 3.3.1
+Stable tag: 1.2.5
Add the ability to attach meta data to the wordpress categories and terms.
It can be used to add meta to custom taxonomies (terms).
@@ -17,9 +17,11 @@ It adds input fields to the category and other term administration interface to
It provides functions to retrive / create / update / delete the category and terms meta.
It can be used to add meta to custom taxonomies (terms).
-This plugin has been tested with WP2.8.6 and WPmu2.8.6 and WP3.0
+This plugin has been tested with WP2.8.6 and WPmu2.8.6 and WP3.3.1
== Update Log ==
+1.2.5 : Small fix to make the image fields work in WordPress 3.3.1.
+
1.2.4 : Small fix to make the meta list appear in the taxonomy edit page with WP3.0.1. && WP3.0.4 (thanks to webgrafia).
1.2.3 : Add a new meta type "check-box" with meta_value of "checked" when the box is checked (thanks to Joseph).
View
@@ -1,15 +1,14 @@
<?php
/*
* Plugin Name: wp-category-meta
- * Plugin URI: #
* Description: Add the ability to attach meta to the Wordpress categories
- * Version: 1.2.4
- * Author: Eric Le Bail
- * Author URI: #
+ * Version: 1.2.5
+ * Author: Randy Hoyt, Eric Le Bail
+ * Author URI: http://randyhoyt.com/
*
- * This plugin has been developped and tested with Wordpress Version 2.8
+ * This plugin has been developped and tested with Wordpress Version 3.3.1
*
- * Copyright 2010 Eric Le Bail (email : eric_lebail@hotmail.com)
+ * Copyright 2012 Randy Hoyt (randyhoyt.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,7 +50,7 @@
global $wptm_db_version;
global $wptm_table_name;
global $wp_version;
-$wptm_version = '1.2.4';
+$wptm_version = '1.2.5';
$wptm_db_version = '0.0.1';
$wptm_table_name = $wpdb->prefix.'termsmeta';
@@ -559,7 +558,7 @@ class="wptm_url_display"><?php if ($current_image_url != '') echo $current_image
</div>
<img src="images/media-button-image.gif"
alt="Add photos from your media" /> <a
- href="media-upload.php?type=image&#038;TB_iframe=1&#038;tab=library&#038;height=500&#038;width=640"
+ href="media-upload.php?type=image&#038;wptm_send_label=<?php echo $inputName; ?>&#038;TB_iframe=1&#038;tab=library&#038;height=500&#038;width=640"
onclick="image_photo_url_add('<?php echo "wptm_".$inputName;?>')"
class="thickbox" title="Add an Image"> <strong><?php echo _e('Click here to add/change your image', 'wp-category-meta');?></strong>
</a><br />
@@ -598,4 +597,5 @@ class="thickbox" title="Add an Image"> <strong><?php echo _e('Click here to add/
</div>
<?php
}
+
?>

0 comments on commit f745e87

Please sign in to comment.