-1

I just had this error pop up on my site a couple days ago:

Parse error: syntax error, unexpected 'if' (T_IF) in /home1/reapusa/public_html/wp-content/plugins/layerslider/wp/actions.php on line 122

I checked out the code that the error is supposedly on, but I'm not seeing any weird characters, missing semicolons, or anything else that might cause an error. I've checked out other threads to see if a solution has already been found, but to no avail.

Am I missing something?

Here's the section of code that's causing the error:

if(isset(
  if(check_admin_referer('hide-revalidation-notice')) {
    update_option('ls-show-revalidation-notice', 0);
    header('Location: admin.php?page=layerslider');
    die();
  }
}
w3spi
  • 4,380
  • 9
  • 47
  • 80
  • if isset() what? [isset](http://www.php.net/manual/en/function.isset.php) tests to see if a variable is set (and not null), what variable are you testing? – Mark Baker Mar 16 '17 at 21:18

2 Answers2

0

You cannot have an if statement inside of a condition. I'm not sure if this will work as I'm not amazing with PHP, but try this:

if(isset(check_admin_referer('hide-revalidation-notice')) {
        update_option('ls-show-revalidation-notice', 0);
        header('Location: admin.php?page=layerslider');
        die();
}
Willothy
  • 431
  • 1
  • 5
  • 20
-2

I think the prob in the first if condition

if(isset(