Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

BUG: php warning when postmeta is empty


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Oct 12, 2009, 05:53 AM
buzink
 
1 posts · Oct 2009
In bfa_postinfo.php on line 16 the implode function is called to make a string out of the meta_values array. When the array is empty, this function returns an ugly php warning that is visible on my blog . This happens when a meta-value is called that is empty for that post.

To fix this, change

Code:
// Callback function for post meta replacement^M
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;
}
to

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

Bookmarks

Tags
bug, byline, meta

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
WARNING: Older WP versions being attacked paulae Installing & running WordPress 1 Dec 7, 2009 01:49 AM
my htaccess is empty cosmiclove New Versions, & Updating 0 Jul 25, 2009 03:33 PM
Was it checked with WP 2.7.1? I am getting multiple message like: Warning ... gm10 New Versions, & Updating 3 May 17, 2009 08:01 PM
Show empty categories olsonsp4c Page & Category Menu Bars 2 Apr 22, 2009 10:41 PM
Bug: with /wp-content/themes/atahualpa3/style.css.php chris Atahualpa 3 Wordpress theme 6 Dec 13, 2008 01:00 AM


All times are GMT -6. The time now is 12:21 PM.


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