-1

I have taken over the 'admin' of a Wordpress website without the benefit of any documentation and it is falling over when creating invoices with this error. Whilst I can do somethings to get it going, I cannot fix broken PHP code and I am hoping that someone can fix this for me to get this working correctly again.

Deprecated: Function create_function() is deprecated in ../public_html/news/wp-content/themes/twentyseventeen-child/functions.php on line 12

The code in functions.php is shown below

<?php



add_filter( 'password_reset_expiration', function( $expiration ) {
    return MONTH_IN_SECONDS;
});

// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

add_action( 'woocommerce_single_product_summary', create_function( '', 'echo "<b><a href=\"https://009society.com/news/shop\">Continue Shopping</a></b>";' ), 35 );


// Increase the password expiration expiration to 5 days
add_filter('password_reset_expiration',function($expiration){return 5 * DAY_IN_SECONDS;});

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
        if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
            $uri = get_template_directory_uri() . '/rtl.css';
        return $uri;
    }
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );

if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
    function chld_thm_cfg_parent_css() {
        wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array(  ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
         
if ( !function_exists( 'child_theme_configurator_css' ) ):
    function child_theme_configurator_css() {
        wp_enqueue_style( 'chld_thm_cfg_separate', trailingslashit( get_stylesheet_directory_uri() ) . 'ctc-style.css', array( 'chld_thm_cfg_parent','twentyseventeen-style','twentyseventeen-block-style','twentyseventeen-colors-dark' ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );

// END ENQUEUE PARENT ACTION

I hope some kind hearted person will repair this error for me and enable the website to run correctly again, until such time as the current total redesign is completed.

Many Thanks

Iain Morrison

Due to not having PHP knowledge I decided it was better not to try anything as I would probably break it completely!

0

1 Answer 1

0

Instead of creating functions through create_function you could just use an anonymous function.

For example:

add_action( 'woocommerce_single_product_summary', function(){
        echo "<b><a href=\"https://009society.com/news/shop\">Continue Shopping</a></b>";
    }, 35 );

Please note that Stack Overflow is not a place to find free software development services. You should try to solve the issue yourself first.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for this - strangely I had looked at several differ things before I posted here, but all the suggestions I had found were much more complex than your simple suggestion which I should add works perfectly ;)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.