Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1484538

    I am getting a flood of deprecation warnings in my error_log file and it is slowing down our server’s performance, especially noticeable when editing posts and pages.

    It appears the offending functions are:
    av_icon_char
    av_icon_class
    av_icon_string

    I cannot find information on what the correct replacements are. Is this something you can help me with?

    Here are some samples of how we are currently using these functions.

    av_icon_char
    $icon = av_icon_char( ‘search’ );

    av_icon_string
    $class = av_icon_class( ‘search’ );

    av_icon_string
    ‘ id=’scroll-top-link’ <?php echo av_icon_string(‘scrolltop’); ?>><span class=”avia_hidden_link_text”><?php _e(‘Scroll to top’, ‘avia_framework’);?></span>

    Here are some examples from the error_log file:

    [21-May-2025 18:26:12 UTC] PHP Deprecated: Function av_icon_char is deprecated since version 7.0! Use No longer used by Enfold instead. in /home/maritimetravel/public_html/wp-includes/functions.php on line 6121
    [21-May-2025 18:26:12 UTC] PHP Deprecated: Function av_icon_class is deprecated since version 7.0! Use No longer used by Enfold instead. in /home/maritimetravel/public_html/wp-includes/functions.php on line 6121
    [21-May-2025 18:26:12 UTC] PHP Deprecated: Function av_icon_char is deprecated since version 7.0! Use No longer used by Enfold instead. in /home/maritimetravel/public_html/wp-includes/functions.php on line 6121
    [21-May-2025 18:26:12 UTC] PHP Deprecated: Function av_icon_class is deprecated since version 7.0! Use No longer used by Enfold instead. in /home/maritimetravel/public_html/wp-includes/functions.php on line 6121

    Our error_log file grows about 200 MB per day.

    Can you please direct me on how we can update our child theme to address these deprecation warnings?

    #1484551

    Hey NicomIT,

    Thank you for the inquiry.

    You can replace the av_icon_string function with:

    avia_font_manager::frontend_icon( $avia_config['font_icons'][ 'search' ]['icon'], $avia_config['font_icons'][ 'search']['font'], 'string', true ); 
    

    For av_icon_char, simply replace the “string” argument with false and remove the third parameter.

    avia_font_manager::frontend_icon( $avia_config['font_icons'][ 'search' ]['icon'], $avia_config['font_icons'][ 'search']['font'], false );
    

    You may also need to set the WP_DEBUG to false.

    https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/

    Best regards,
    Ismael

    #1484584

    Thanks, Ismael.

    What about the av_icon_class function? What is the replacement for this? As in:

    $class = av_icon_class( ‘search’ );

    #1484594

    Hi,

    Thank you for the update.

    There is no replacement for the av_icon_class, but you can create your own utility function by using this code.

    global $avia_config;
    return 'avia-font-' . $avia_config['font_icons'][ $char ]['font'];
    

    This is the current av_icon_class function for reference.

    /**
     * pass a string that matches one of the key of the global font_icons array to get the font class
     *
     * @since ????
     * @deprecated since 7.0
     * @param string $char
     * @return string
     */
    function av_icon_class( $char )
    {
    	global $avia_config;
    
    	_deprecated_function( 'av_icon_class', '7.0', 'No longer used by Enfold' );
    
    	return 'avia-font-' . $avia_config['font_icons'][ $char ]['font'];
    }
    

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.