致命错误:激活更新的插件时,在helpers.php中调用未定义的函数get_custom_column_class()

时间:2015-09-29 17:23:26

标签: php wordpress methods wordpress-plugin fatal-error

我需要帮助找出未定义的函数错误get_custom_column_class()

if( ! function_exists( 'haze_translateColumnWidthToSpan' ) ) :

    function haze_translateColumnWidthToSpan($width, $front = true) {
        if(preg_match('/^(\d{1,2})\/12$/', $width, $match)) {
            $w = "col-md-".$match[1];
        } else {
            switch ( $width ) {
                case "1/6" :
                    $w = "col-sm-2";
                    break;
                case "1/4" :
                    $w = "col-sm-3";
                    break;
                case "1/3" :
                    $w = "col-sm-4";
                    break;
                case "1/2" :
                    $w = "col-sm-6";
                    break;
                case "2/3" :
                    $w = "col-sm-8";
                    break;
                case "3/4" :
                    $w = "col-sm-9";
                    break;
                case "5/6" :
                    $w = "col-sm-10";
                    break;
                case "1/1" :
                    $w = "col-sm-12";
                    break;
                case "2/4" :
                    $w = "col-sm-6";
                    break;
                default :
                    $w = $width;
            }
        }

        $custom = $front ? get_custom_column_class($w): false;
        return $custom ? $custom : $w;

请帮忙。

谢谢,

1 个答案:

答案 0 :(得分:0)

雾霾替换为 wpb

if(!function_exists('haze_translateColumnWidthToSpan')):

function haze_translateColumnWidthToSpan($width, $front = true) {

还要转到主题文件夹 folder vc_templates> vc_column.php

wpb 替换 haze  在vc_column.php的第11行

$ width = haze_translateColumnWidthToSpan($ width);

只有两个文件。