2
if ( ! function_exists( 'wp' ) && ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
    die ( 'You do not have sufficient permissions to access this page!' );
}

I find these lines of code in index.php of a theme in WordPress.
What is the logic behind these lines?

1 Answer 1

1

Basically Its a check if the index.php file is accessed directly and not by WordPress, if the first is the case then the scripts stops the execution , displays a message

You do not have sufficient permissions to access this page!

And stops farther execution for the script.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.