首页 > 解决方案 > 致命错误:未捕获的错误:调用未定义的函数 optionsframework_options()

问题描述

我已经用最新的 wordpress 版本更新了我的网站,但现在主题选项不适用于此错误:

Fatal error: Uncaught Error: Call to undefined function optionsframework_options() in /home/customer/www/dimaurorivestimenti.it/public_html/wp-content/themes/Primero/admin/options-interface.php:25 Stack trace: #0 /home/customer/www/dimaurorivestimenti.it/public_html/wp-content/themes/Primero/admin/options-framework.php(209): optionsframework_fields() #1 /home/customer/www/dimaurorivestimenti.it/public_html/wp-includes/class-wp-hook.php(292): optionsframework_page('') #2 /home/customer/www/dimaurorivestimenti.it/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array) #3 /home/customer/www/dimaurorivestimenti.it/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #4 /home/customer/www/dimaurorivestimenti.it/public_html/wp-admin/admin.php(259): do_action('appearance_page...') #5 /home/customer/www/dimaurorivestimenti.it/public_html/wp-admin/themes.php(10): require_once('/home/customer/...') #6 {main} thrown in /home/customer/www/dimaurorivestimenti.it/public_html/wp-content/themes/Primero/admin/options-interface.php on line 25

你能帮我解决吗?

编辑:这是文件内的代码:

function optionsframework_fields() {

    global $allowedtags;
    $optionsframework_settings = get_option('optionsframework');
    
    // Get the theme name so we can display it up top
    $themename = get_theme_data(STYLESHEETPATH . '/style.css');
    $themename = $themename['Name'];
    
    // Gets the unique option id
    if (isset($optionsframework_settings['id'])) {
        $option_name = $optionsframework_settings['id'];
        
    }
    else {
        $option_name = 'optionsframework';
    };

    $settings = get_option($option_name);
    $options = optionsframework_options();
        
    $counter = 0;
    $menu = '';
    $output = '';

标签: wordpressframeworksoption

解决方案


我刚刚检查过它,我将它从 7.3 更改为 7.2、7.1 和 7.0,但错误最严重

Fatal error: Uncaught Error: Call to undefined function optionsframework_options() in /home/customer/www/dimaurorivestimenti.it/public_html/wp-content/themes/Primero/admin/options-interface.php:27 Stack trace: #0 /home/customer/www/dimaurorivestimenti.it/public_html/wp-content/themes/Primero/admin/options-framework.php(209): optionsframework_fields() #1 /home/customer/www/dimaurorivestimenti.it/public_html/wp-includes/class-wp-hook.php(292): optionsframework_page('') #2 /home/customer/www/dimaurorivestimenti.it/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array) #3 /home/customer/www/dimaurorivestimenti.it/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #4 /home/customer/www/dimaurorivestimenti.it/public_html/wp-admin/admin.php(259): do_action('appearance_page...') #5 /home/customer/www/dimaurorivestimenti.it/public_html/wp-admin/themes.php(10): require_once('/home/customer/...') #6 {main} thrown in /home/customer/www/dimaurorivestimenti.it/public_html/wp-content/themes/Primero/admin/options-interface.php on line 27

然后,当我将 php 版本设置为 5.6.40 时,错误只是

Fatal error: Call to undefined function optionsframework_options() in /home/customer/www/dimaurorivestimenti.it/public_html/wp-content/themes/Primero/admin/options-interface.php on line 27

推荐阅读