1

I got an error on my site.

Fatal error: Can't use function return value in write context in /home4/massspreadz/public_html/www.gamagesteelfurniture.lk/wp-content/plugins/booking/core/admin/wpbc-class-timeline.php on line 1258

Here is the code that is causing the error:

//FixIn: 8.1.3.34
if ( ! empty( get_bk_option( 'booking_time_format') ) ) {
    $time_show = date_i18n( str_replace( ':i', '', get_bk_option( 'booking_time_format' ) ), mktime( $tt * $tm , 0, 0 ) );
    echo ( $view_days_num < 31 ) ? $time_show : '';
} else {
    echo ( ( $view_days_num < 31 ) ? ( ( ($tt*$tm) < 10?'0':'') . ($tt*$tm) . '<sup>:00</sup>' ) : '' );
}
?></div><?php
1
  • 1
    Welcome to Stack Overflow. Please take your time to format the question to be readable. Use the edit link under the question, select the code and press the {} button in the editor's toolbar to nicely format it as code. Before pressing Save Edits, check the preview under the editor to see how the question looks like. Commented Jun 27, 2018 at 15:22

1 Answer 1

1

You need to change the following line:

if ( ! empty( get_bk_option( 'booking_time_format') ) ) {

To something like this:

$bkOption = get_bk_option( 'booking_time_format');

if ( ! empty( $bkOption ) ) {

Note:

Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.

So, your current php version can't handle this. Read the manual for more information.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.