0
At the end of studies I am creating a Wordpress theme, in completion phase.
Throughout creation I came across the following code, we call "code1":
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Which prevents direct access to my . php files directly from the URL.
This we call "code2", found in wp-config.php:
/** Caminho absoluto para o diretório WordPress. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
Below is my question:
Then it would be recommended to add the "code1" in the pages of the Wordpress theme? or it has the same function of the "code2" found in wp-config.php
Came to me is doubtful after seeing the "code1" within a Wordpress theme already ready, which contained the "code1" within all. php files.