• Hi

    After updating to latest version, my search function reports error. Below is the part of the function that reports errors and is on line “,addSearchCondition(‘fuldenavn’,$metavalue)”. Function works fine until i update astra theme. Have you changed anything in the code of functions.php?

    /* Start*/
    add_shortcode(‘user_search’,’My_User_search’);
    function My_User_search($atts = null){
    $out = user_search_form();
    if (isset($_GET[‘user_search’]) && $_GET[‘user_search’] == “search_users”){
    global $wpdb;
    /* diabled searchby
    $metakey = $_GET[‘search_by’];
    */
    $metavalue = esc_attr( trim( $_GET[‘s_value’] ) );

    if( trim( $metavalue ) == false ){
    $out .= responseBody(error_missing_keyword_message());
    return $out;
    }

    /* if search by name, fuzzy search will apply */
    /* else search by custom fields */
    $default_query = array(
    ‘meta_query’ => array(‘relation’ => ‘OR’
    ,addSearchCondition(‘fuldenavn’,$metavalue) //Error is on this line
    ,addSearchCondition(‘post_nr’,$metavalue)
    ,addSearchCondition(‘by’,$metavalue)
    ,addSearchCondition(‘job_title’,$metavalue)
    ,addSearchCondition(‘firma’,$metavalue)
    ,addSearchCondition(‘tlf’,$metavalue)
    ,addSearchCondition(‘firma_adresse’,$metavalue)

    ));

    Sasha

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter salac

    (@salac)

    I forgot to mention that I using child theme

    Hello @salac

    If you have used the Custom Function in the child theme, it should not be affected by the theme update.

    While can you try switching to the parent theme to see if it helps resolve the issue?

    If you are still facing the issue, you might want to verify the Child theme code. And if you need the previous version of the theme for comparison you can find it here.

    I hope that helps.

    Regards,
    Suman

    Thread Starter salac

    (@salac)

    Hi Suman

    I have tried switching to parent theme, but no luck.
    Page builder is Elementor and I keep getting this notification in elementor debugger.

    Template File: No Templates for condition > /themes/astra/page.php

    Regards
    Sasha

    Hello @salac

    I am not sure, what is the condition the custom code is looking for.

    Can you verify the code? As the Custom Code needs to be re-checked to fix this issue.

    There’s nothing from the functions.php of the current theme update that could cause this issue.

    I hope that helps.

    Regards,
    Suman

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Latest version – custom function error’ is closed to new replies.