I have a PHP ERROR

Level: Deprecated
Message: Function create_function() is deprecated
Count: 1
Location: wp-content/themes/sydney-pro-child/functions.php:36
wp-settings.php
wp-settings.php:514

How is this error adjusted?
Thanks,
Fabio

Hi Fabio,

Thank you for contacting us.

I am sorry to hear that you have run into an issue. I am happy to help out.

The file location shows it is a specific issue with your child theme. To confirm this, you may want to disable it and enable the Sydney Pro theme temporarily.

Can you inform your purpose to add create_function() in child theme?

Regards,
Kharis
aThemes Support

Hi Kharis,

Thank you for replying to my query.

Yes, the PHP error stems from my Child Theme of Sydney Pro.
I didn’t add any create_funcion() to the child theme. When I use the developer toon in chrome, I always see this PHP error and wanted to bring it to your attention.
Below is the full content of the function.php from the child theme.

<?php
/**
 * Sydney child functions
 *
 */


/**
 * Enqueues the parent stylesheet. Do not remove this function.
 *
 */
add_action( 'wp_enqueue_scripts', 'sydney_pro_child_enqueue' );
function sydney_pro_child_enqueue() {
    
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}




function fb_filter_query( $query, $error = true ) {

	if ( is_search() ) {
		$query->is_search = false;
		$query->query_vars[s] = false;
		$query->query[s] = false;

		// to error
		if ( $error == true )
			$query->is_404 = true;
	}
}

add_action( 'parse_query', 'fb_filter_query' );
add_filter( 'get_search_form', create_function( '$a', "return null;" ) );

/* ADD YOUR CUSTOM UM FIELD FUNCTIONS BELOW */
/**
 * Change a filter type in the member directory
 * Available types: 'text', 'select', 'slider', 'datepicker', 'timepicker'
 *
 * @author  Ultimate Member support <support@ultimatemember.com>
 * @since   2020-05-03
 * @see     #39526
 *
 * @param   array  $filter_types
 */
function custom_um_members_directory_filter_types( $filter_types ) {
	$filter_types['firm_bcin'] = 'text';
	$filter_types['individual_bcin'] = 'text';

	return $filter_types;
}
add_filter( 'um_members_directory_filter_types', 'custom_um_members_directory_filter_types', 20 );

/* ADD YOUR CUSTOM FUNCTIONS BELOW */

Hello there,

Thank you for sharing the code.

Can you remove this line?

add_filter( 'get_search_form', create_function( '$a', "return null;" ) );

Regards,
Kharis
aThemes Support

Hi Kharis,

I’ve followed your request and removed the line you have stated. The PHP error has been resolved.

Thank you for your follow up this issue. You have been a great help.

Regards,

Fabio

You’re welcome Fabio!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis
aThemes Support