<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Custom Meta for new Taxonomies in WordPress 3.0</title>
	<atom:link href="http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/</link>
	<description>I'm the Devil in the code!</description>
	<lastBuildDate>Wed, 01 Feb 2012 21:45:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Empire</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-171767</link>
		<dc:creator>Empire</dc:creator>
		<pubDate>Tue, 17 Jan 2012 22:19:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-171767</guid>
		<description>?&quot;Its always good to learn tips like you share for blog posting. As I just started posting comments for blog and facing problem of lots of rejections. I think your suggestion would be helpful for me. I will let you know if its work for me too.&quot;</description>
		<content:encoded><![CDATA[<p>?&#8221;Its always good to learn tips like you share for blog posting. As I just started posting comments for blog and facing problem of lots of rejections. I think your suggestion would be helpful for me. I will let you know if its work for me too.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 2046</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-166036</link>
		<dc:creator>2046</dc:creator>
		<pubDate>Tue, 03 Jan 2012 09:41:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-166036</guid>
		<description>Because I wanted to make couple new meta fields for taxonomies and was bored to manually duplicate tables. I made this sql command:

CREATE TABLE IF NOT EXISTS `wp_METANAMEmeta` (
  `meta_id` int(20) unsigned NOT NULL AUTO_INCREMENT,
  `METANAME_id` int(20) unsigned NOT NULL,
  `meta_key` varchar(255) DEFAULT NULL,
  `meta_value` longtext,
  PRIMARY KEY (`meta_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

Change the  &quot;METANAME&quot; according to your meta name. Plus be aware that it creates the table in UTF-8 decoding!</description>
		<content:encoded><![CDATA[<p>Because I wanted to make couple new meta fields for taxonomies and was bored to manually duplicate tables. I made this sql command:</p>
<p>CREATE TABLE IF NOT EXISTS `wp_METANAMEmeta` (<br />
  `meta_id` int(20) unsigned NOT NULL AUTO_INCREMENT,<br />
  `METANAME_id` int(20) unsigned NOT NULL,<br />
  `meta_key` varchar(255) DEFAULT NULL,<br />
  `meta_value` longtext,<br />
  PRIMARY KEY (`meta_id`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;</p>
<p>Change the  &#8220;METANAME&#8221; according to your meta name. Plus be aware that it creates the table in UTF-8 decoding!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damian</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-135660</link>
		<dc:creator>Damian</dc:creator>
		<pubDate>Sat, 15 Oct 2011 14:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-135660</guid>
		<description>Thanks for all the info!! It helped me a lot.
You can also save all data into the options table instead of creating new tables in the database.
I did the following for my &quot;galleries&quot; taxonomie

add_action( &#039;edited_galleries&#039;, &#039;save_extra_category_fileds&#039;, 10, 2);
   // save extra category extra fields callback function
function save_extra_category_fileds( $term_id, $tt_id ) {
    if ( isset( $_POST[&#039;Cat_meta&#039;] ) ) {
        $t_id = $term_id;
        $cat_meta = get_option( &quot;category_$t_id&quot;);
        $cat_keys = array_keys($_POST[&#039;Cat_meta&#039;]);
            foreach ($cat_keys as $key){
            if (isset($_POST[&#039;Cat_meta&#039;][$key])){
                $cat_meta[$key] = $_POST[&#039;Cat_meta&#039;][$key];
            }
        }
        //save the option array
        update_option( &quot;category_$t_id&quot;, $cat_meta );
    }
}

//add extra fields to category edit form hook
add_action ( &#039;galleries_edit_form_fields&#039;, &#039;extra_category_fields&#039;, 10, 2);
//add extra fields to category edit form callback function
function extra_category_fields( $tag , $taxonomy) {    //check for existing featured ID
    $t_id = $tag-&gt;term_id;
    $cat_meta = get_option( &quot;category_$t_id&quot;);
?&gt;



&lt;input type=&quot;text&quot; name=&quot;Cat_meta[img]&quot; id=&quot;Cat_meta[img]&quot; size=&quot;3&quot; style=&quot;width:60%;&quot; value=&quot;&quot;&gt;
            
        

&lt;?php
}</description>
		<content:encoded><![CDATA[<p>Thanks for all the info!! It helped me a lot.<br />
You can also save all data into the options table instead of creating new tables in the database.<br />
I did the following for my &#8220;galleries&#8221; taxonomie</p>
<p>add_action( &#8216;edited_galleries&#8217;, &#8216;save_extra_category_fileds&#8217;, 10, 2);<br />
   // save extra category extra fields callback function<br />
function save_extra_category_fileds( $term_id, $tt_id ) {<br />
    if ( isset( $_POST['Cat_meta'] ) ) {<br />
        $t_id = $term_id;<br />
        $cat_meta = get_option( &#8220;category_$t_id&#8221;);<br />
        $cat_keys = array_keys($_POST['Cat_meta']);<br />
            foreach ($cat_keys as $key){<br />
            if (isset($_POST['Cat_meta'][$key])){<br />
                $cat_meta[$key] = $_POST['Cat_meta'][$key];<br />
            }<br />
        }<br />
        //save the option array<br />
        update_option( &#8220;category_$t_id&#8221;, $cat_meta );<br />
    }<br />
}</p>
<p>//add extra fields to category edit form hook<br />
add_action ( &#8216;galleries_edit_form_fields&#8217;, &#8216;extra_category_fields&#8217;, 10, 2);<br />
//add extra fields to category edit form callback function<br />
function extra_category_fields( $tag , $taxonomy) {    //check for existing featured ID<br />
    $t_id = $tag-&gt;term_id;<br />
    $cat_meta = get_option( &#8220;category_$t_id&#8221;);<br />
?&gt;</p>
<p>&lt;input type=&quot;text&quot; name=&quot;Cat_meta[img]&quot; id=&quot;Cat_meta[img]&quot; size=&quot;3&quot; style=&quot;width:60%;&quot; value=&quot;&#8221;&gt;</p>
<p>&lt;?php<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zakir</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-125456</link>
		<dc:creator>Zakir</dc:creator>
		<pubDate>Fri, 23 Sep 2011 13:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-125456</guid>
		<description>Sorted out.</description>
		<content:encoded><![CDATA[<p>Sorted out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zakir</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-125404</link>
		<dc:creator>Zakir</dc:creator>
		<pubDate>Fri, 23 Sep 2011 11:26:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-125404</guid>
		<description>I have a problem. The extra fields only show up on the edit screen. They don’t show on Add Categoy for the taxonomy. My version of wordpress is 3.2.1. 

any clues?</description>
		<content:encoded><![CDATA[<p>I have a problem. The extra fields only show up on the edit screen. They don’t show on Add Categoy for the taxonomy. My version of wordpress is 3.2.1. </p>
<p>any clues?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Imbrogno</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-121641</link>
		<dc:creator>Dan Imbrogno</dc:creator>
		<pubDate>Tue, 13 Sep 2011 14:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-121641</guid>
		<description>Great article! I&#039;d recommend to other readers to read this entire article first before you try to follow along. I kept skipping steps thinking I knew what I was doing, only to realize my mistakes were covered further on in the article.</description>
		<content:encoded><![CDATA[<p>Great article! I&#8217;d recommend to other readers to read this entire article first before you try to follow along. I kept skipping steps thinking I knew what I was doing, only to realize my mistakes were covered further on in the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iframe</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-117897</link>
		<dc:creator>iframe</dc:creator>
		<pubDate>Mon, 29 Aug 2011 20:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-117897</guid>
		<description>Good. Very good</description>
		<content:encoded><![CDATA[<p>Good. Very good</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hp mini 210</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-117591</link>
		<dc:creator>hp mini 210</dc:creator>
		<pubDate>Sun, 28 Aug 2011 02:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-117591</guid>
		<description>Tired of getting low amounts of useless traffic for your website? Well i want to inform you of a new underground tactic that makes me personally $900  each day on 100% AUTOPILOT. I could be here all day and going into detail but why dont you simply check their site out? There is really a excellent video that explains everything. So if your seriously interested in making quick hard cash this is the site for you. Auto Traffic Avalanche</description>
		<content:encoded><![CDATA[<p>Tired of getting low amounts of useless traffic for your website? Well i want to inform you of a new underground tactic that makes me personally $900  each day on 100% AUTOPILOT. I could be here all day and going into detail but why dont you simply check their site out? There is really a excellent video that explains everything. So if your seriously interested in making quick hard cash this is the site for you. Auto Traffic Avalanche</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bubble pop game</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-114878</link>
		<dc:creator>bubble pop game</dc:creator>
		<pubDate>Mon, 15 Aug 2011 20:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-114878</guid>
		<description>My spouse and I absolutely love your blog and find the majority of your post&#039;s to be exactly what I&#039;m looking for. Does one offer guest writers to write content for yourself? I wouldn&#039;t mind publishing a post or elaborating on some of the subjects you write about here. Again, awesome blog!</description>
		<content:encoded><![CDATA[<p>My spouse and I absolutely love your blog and find the majority of your post&#8217;s to be exactly what I&#8217;m looking for. Does one offer guest writers to write content for yourself? I wouldn&#8217;t mind publishing a post or elaborating on some of the subjects you write about here. Again, awesome blog!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andres Hermosilla</title>
		<link>http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/comment-page-1/#comment-112379</link>
		<dc:creator>Andres Hermosilla</dc:creator>
		<pubDate>Wed, 03 Aug 2011 22:28:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.codehooligans.com/?p=553#comment-112379</guid>
		<description>Awesome article! Helped tons! For the DB I just used 
	global $wpdb;
	  $table_name = $wpdb-&gt;prefix . &quot;locationmeta&quot;;
	 require_once(ABSPATH . &#039;wp-admin/includes/upgrade.php&#039;);

 
   if($wpdb-&gt;get_var(&quot;show tables like &#039;$table_name&#039;&quot;) != $table_name) {


      $sql = &quot;CREATE TABLE $wpdb-&gt;dbname.$table_name (
	 meta_id BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
location_id BIGINT( 20 ) NOT NULL DEFAULT &#039;0&#039;,
meta_key VARCHAR( 255 ) NULL ,
meta_value LONGTEXT NULL DEFAULT NULL 
	) ENGINE = MYISAM ;
	  &quot;;
	 }
     
      dbDelta($sql);
	 $results = $wpdb-&gt;query( $insert );</description>
		<content:encoded><![CDATA[<p>Awesome article! Helped tons! For the DB I just used<br />
	global $wpdb;<br />
	  $table_name = $wpdb-&gt;prefix . &#8220;locationmeta&#8221;;<br />
	 require_once(ABSPATH . &#8216;wp-admin/includes/upgrade.php&#8217;);</p>
<p>   if($wpdb-&gt;get_var(&#8220;show tables like &#8216;$table_name&#8217;&#8221;) != $table_name) {</p>
<p>      $sql = &#8220;CREATE TABLE $wpdb-&gt;dbname.$table_name (<br />
	 meta_id BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,<br />
location_id BIGINT( 20 ) NOT NULL DEFAULT &#8217;0&#8242;,<br />
meta_key VARCHAR( 255 ) NULL ,<br />
meta_value LONGTEXT NULL DEFAULT NULL<br />
	) ENGINE = MYISAM ;<br />
	  &#8220;;<br />
	 }</p>
<p>      dbDelta($sql);<br />
	 $results = $wpdb-&gt;query( $insert );</p>
]]></content:encoded>
	</item>
</channel>
</rss>

