Eliminating the appearance of a specific custom field in a post

The function, the_meta() allows you to hook to the the_meta_key filter (which currently is not documented in the Codex); this is where it fires off: // wp-includes/post-templates.php @line 744 echo apply_filters(‘the_meta_key’, “<li><span class=”post-meta-key”>$key:</span> $value</li>\n”, $key, $value); http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/post-template.php#L735 This filter is applied to each and every meta pair, which means that you can add a filter … Read more

Custom fields to taxonomy

You can hook into the edit form field action of that specific taxonomy. If you look in /wp-admin/edit-tag-form.php there are hooks for every taxonomy. Starting at Line 69: if ( ‘category’ == $taxonomy ) do_action(‘edit_category_form_fields’, $tag); elseif ( ‘link_category’ == $taxonomy ) do_action(‘edit_link_category_form_fields’, $tag); else do_action(‘edit_tag_form_fields’, $tag); do_action($taxonomy . ‘_edit_form_fields’, $tag, $taxonomy); So for a … Read more

load custom fields on click

I don’t know if you’ve found an answer on this question yet since it’s from 2011 but I have an idea on how to retrieve the data. What if you created a VERY simple php file that took the post ID as a get variable and displayed the post’s custom fields? It would look something … Read more

Custom Fields Not in Search Results

You can use an custom plugin for your custom fields function fb_custom_search_where($where) { // put the custom fields into an array $customs = array(‘custom_field1’, ‘custom_field2’, ‘custom_field3’); foreach( $customs as $custom ) { $query .= ” OR (“; $query .= “( m.meta_key = ‘$custom’ )”; $query .= ” AND ( m.meta_value LIKE ‘{$n}{$term}{$n}’ )”; $query .= … Read more

Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)

Definite solution: Seeing as wp’s core get_post_custom function returns multiple data fields saved as a single key in a random order, I resolved the issue by writing a function to replace it – which has some added flexibility: /*————————————————————— Function: Retrieve post meta field for a post based on ID Usage: [admin/meta_box/downloads.php] = to replace … Read more