Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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


  #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 07:50 AM.


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