【问题标题】:Fatal error: Call to undefined function get_custom_column_class() in helpers.php when activating updated plugin致命错误:激活更新插件时调用 helpers.php 中未定义的函数 get_custom_column_class()
【发布时间】:2015-09-29 17:23:26
【问题描述】:

我需要帮助找出这个未定义的函数错误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;

请帮忙。

谢谢,

【问题讨论】:

  • get_custom_column_class() 不是 WordPress 功能,也没有被定义……关于它,没有什么可说的了。如果你想使用它,你需要定义那个函数。
  • 不熟悉 WP,但在 github 上快速搜索了几个使用此功能的 repo(例如this one)。我的猜测是它是一些 wp 插件的一部分。安装那个

标签: php methods wordpress fatal-error


【解决方案1】:

将 haze 替换为 wpb

如果(!function_exists('haze_translateColumnWidthToSpan')):

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

也去你的主题文件夹 文件夹 vc_templates > vc_column.php

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

$width = haze_translateColumnWidthToSpan($width);

只有两个文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-31
    相关资源
    最近更新 更多