0

I'm trying to upload a plugin on my WordPress site and I get the following error below:

Fatal error: Can't use function return value in write context on line 491.

Here is the code that is in question. Any help is appreciated!

        if ( empty( get_post_meta( $order_id, '_sent_to_fba', true ) ) ) {
            return '';
        }
Rav
  • 1,327
  • 3
  • 18
  • 32
Jimmy
  • 1
  • 1
  • Have a look at [this answer](http://stackoverflow.com/a/2173318/1714). Try storing the result of the `get_post_meta()` call in a variable, then calling `empty()` using the variable. – Hobo Dec 19 '16 at 04:26

1 Answers1

1

Please check your php version.Note: 5.4.0 Checking non-numeric offsets of strings returns TRUE.If 5.5.0 empty() now supports expressions, rather than only variables.

$somevar = get_post_meta( $order_id, '_sent_to_fba', true );

  if(empty($somevar ))
  { return '';}

For more information please check this link http://php.net/manual/en/function.empty.php

Vasim Shaikh
  • 4,485
  • 2
  • 23
  • 52