Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   Custom Fields Cannot be Deleted (http://forum.bytesforall.com/showthread.php?t=2451)

elenniel Jul 15, 2009 01:00 PM

Custom Fields Cannot be Deleted
 
I was trying to display custom fields in the footer of my posts with %meta% and then all of a sudden I had a bunch of custom fields that I didn't create myself and that I just cannot seem to get rid of.
If I delete them, when I update the post they just come right back. When I try a new post, they automatically appear.

The automatic custom fields I get are:-
  • bfa_ata_meta_title
  • bfa_ata_meta_keywords
  • bfa_ata_body_title_multi
  • bfa_ata_display_body_title
  • bfa_ata_body_title
  • bfa_ata_meta_description

If I have a "Listening to" field or a "Reading" field then those will appear, but alongside all the bfa_ata_ fields which I don't want.

Here's a cropped screenshot of what I see on a post.

The bfa_ata_ custom fields don't appear for the posts I made before I started using Atahualpa, but only for those I made after it, which is quite recently.
(There's only one exception and I've no idea why that one in particular seems fine whereas the others aaall have the extra custom fields displayed.)

I've been at this for hours already and I still can't seem to find a solution. Help, anyone? :confused:

Flynn Jul 15, 2009 08:01 PM

These are the new post/page options, see the other box higher up on the page right below the write panel "Atahualpa post options".

The post info item %meta% became kinda useless through that, I had not thought about that. I'll put something in to exclude those when %meta% is used.

For now, can you use %meta('fieldname')% instead?

elenniel Jul 16, 2009 03:22 AM

Quote:

Originally Posted by Flynn (Post 10432)
For now, can you use %meta('fieldname')% instead?

If I do that, two things happen:
(1) If the post has no fields assigned to it, I get an error message in the footer where I inserted the meta, presumably because the bfa_ata_ fields are still automatically assigned to the post somehow, although they're blank.
Again, this only happens for recent posts. Posts prior to my switch to Atahualpa are fine. :/

The error message says:
Warning: implode() [function.implode]: Bad arguments. in C:\Inetpub\vhosts\elvenstar.net\subdomains\ind\htt pdocs\wp-content\themes\atahualpa\functions\bfa_postinfo.ph p on line 16


(2) I can only use it for one custom field key - say, for example %meta('feeling')%
If I try and add more (I used to use about three or four at most - "Feeling", "Listening to", "Readi ng" and "Watching"), then I get the same error message in the footer alongside the "Feeling" meta, about bfa_postinfo.php

So... yes. It's very perplexing to me. :/

Flynn Jul 16, 2009 02:47 PM

For %meta('fieldname')% try this: Replace in functions/postinfo.php, line 12-18, this
PHP Code:

// Callback function for post meta replacement
function meta_values($matches) {
    
$meta_key $matches[1];
    
// "get_post_custom_values" returns an array. Turn it into a string, separated by commata
    
$meta_values implode(", "get_post_custom_values($meta_key));
    return 
$meta_values;


with this:

PHP Code:

// Callback function for post meta replacement
function meta_value($matches) {
    global 
$post;
    return 
get_post_meta($post->ID$matches[1], true);


For %meta%, starting at line 559 in postinfo.php, you can add the red part to remove the bfa_ata... keys & values

/* The meta = ALL custom fields:values, formatted by Wordpress as
unordered list <ul><li>..</li><li>..</li></ul> */
if ( strpos($postinfo_string,'%meta%') !== FALSE ) {
ob_start();
the_meta();
$the_meta = ob_get_contents();
ob_end_clean();
$the_meta = preg_replace("/<li>(.*)bfa_ata(.*)<\/li>/i", "", $the_meta);
$postinfo = str_replace("%meta%", $the_meta, $postinfo);
}

elenniel Jul 17, 2009 03:27 AM

Wonderful! Problem solved. :D (Well, the bfa_ata_ options still appear in the custom fields list if I go back to edit the post, but since they don't appear on the post itself, I'm fine with that :] )
Thanks so much, Flynn!

sendilnathan Aug 29, 2009 04:23 PM

2 Attachment(s)
I am having rows and rows of Custom Fields I never entered. If I delete one, I only get more. This is really weird. I have another page where I have over 50 custom fields all self-generated from the Atahualpa Page Options where I put values into the 4 rows.

I deleted the values in the Atahualpa Page Options' 4 rows and all I have is 50 blank custom fields with values on the left hand side for custom fields such as bfa_ata_body_title_saved, bfa_ata_body_title, bfa_ata_meta_description... and several blank on both right & left custom fields.

Also, every time I save the page I get more of these custom fields that are growing indiscriminately.

btw, all of this is in Manage>>Pages.

I am using Atahualpa 3.4.1 and WordPress version 2.6.2

Flynn Aug 31, 2009 08:00 AM

I suggest to update to 3.4.2, Atahualpa is still evolving fast and I need to focus on the current and next versions


All times are GMT -6. The time now is 05:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.