• Greetings all!

    For some time I’ve had an issue with our WordPress site which has gone unresolved. I get an error message when logging in, either at the back or front, but am then able to login once I refresh.

    Maybe it’s simply a matter of editing some code and someone is able to assist.

    Many thanks in advance.

    Error details are as follows:

    When seeking help with this issue, you may be asked for some of the following information:
    WordPress version 6.2.2
    Active theme: X – Child Theme (version 1.0.0)
    Current plugin: (version )
    PHP version 8.1.20
    
    Error Details
    
    An error of type E_ERROR was caused in line 69 of the file /usr/www/users/compudp/pibella.co.za/wp-content/themes/x-child/functions.php. Error message: Uncaught Error: Call to undefined function x_is_shop() in /usr/www/users/compudp/pibella.co.za/wp-content/themes/x-child/functions.php:69
    Stack trace:
    
    0 /usr/www/users/compudp/pibella.co.za/wp-includes/class-wp-hook.php(310): {closure}(NULL, 1358, '_wp_attached_fi…', true)
    
    1 /usr/www/users/compudp/pibella.co.za/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array)
    
    2 /usr/www/users/compudp/pibella.co.za/wp-includes/meta.php(633): apply_filters('get_post_metada…', NULL, 1358, '_wp_attached_fi…', true, 'post')
    
    3 /usr/www/users/compudp/pibella.co.za/wp-includes/meta.php(572): get_metadata_raw('post', 1358, '_wp_attached_fi…', true)
    
    4 /usr/www/users/compudp/pibella.co.za/wp-includes/post.php(2492): get_metadata('post', 1358, '_wp_attached_fi…', true)
    
    5 /usr/www/users/compudp/pibella.co.za/wp-includes/post.php(723): get_post_meta(1358, '_wp_attached_fi…', true)
    
    6 /usr/www/users/compudp/pibella.co.za/wp-includes/post.php(6733): get_attached_file(1358)
    
    7 /usr/www/users/compudp/pibella.co.za/wp-includes/post.php(6786): wp_attachment_is('image', Object(WP_Post))
    
    8 /usr/www/users/compudp/pibella.co.za/wp-content/plugins/woocommerce/includes/class-wc-install.php(1787): wp_attachment_is_image('1358')
    
    9 /usr/www/users/compudp/pibella.co.za/wp-content/plugins/woocommerce/includes/class-wc-install.php(1772): WC_Install::create_placeholder_image()
    
    10 /usr/www/users/compudp/pibella.co.za/wp-content/plugins/woocommerce/includes/class-wc-install.php(405): WC_Install::create_files()
    
    11 /usr/www/users/compudp/pibella.co.za/wp-content/plugins/woocommerce/includes/class-wc-install.php(265): WC_Install::install()
    
    12 /usr/www/users/compudp/pibella.co.za/wp-includes/class-wp-hook.php(308): WC_Install::check_version('')
    
    13 /usr/www/users/compudp/pibella.co.za/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    
    14 /usr/www/users/compudp/pibella.co.za/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    
    15 /usr/www/users/compudp/pibella.co.za/wp-settings.php(623): do_action('init')
    
    16 /usr/www/users/compudp/pibella.co.za/wp-config.php(95): require_once('/usr/www/users/…')
    
    17 /usr/www/users/compudp/pibella.co.za/wp-load.php(50): require_once('/usr/www/users/…')
    
    18 /usr/www/users/compudp/pibella.co.za/wp-login.php(12): require('/usr/www/users/…')
    
    19 {main}
    
    thrown

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Ralf,

    This bit is helpful:

    Error: Call to undefined function x_is_shop() in /usr/www/users/compudp/pibella.co.za/wp-content/themes/x-child/functions.php:69

    The source of this error message must be located in your child theme’s functions file. Would you mind sharing the code from that file for us please?

    What version of the X theme are you using btw?

    Cheers,
    Vic

    Thread Starter Ralf_CT

    (@ralf_ct)

    Hi Vic, thank you for your prompt response. X Theme version is 10.2.7. X-Child Theme version 1.0.0 (active). I hope the below helps, there are no line numbers.

    functions.php code:

    // Slider on Productpage
    //=================================================================================================

    $filter_called = array();

    add_filter(‘get_post_metadata’, function( $value, $object_id, $meta_key, $single ){

    $page_id = get_option( ‘woocommerce_shop_page_id’ );

    global $filter_called;

    if( ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) && empty($value) ) {

    if( !in_array($meta_key, $filter_called ) ) {

    $filter_called[] = $meta_key;

    Thread Starter Ralf_CT

    (@ralf_ct)

    Hi Vic, please check if you can assist further with the above, or if you require further info.

    Many thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘E_ERROR caused in line 69… functions.php’ is closed to new replies.