Thursday, April 5, 2018

if ( ! defined( 'WPINC' ) ) die;
and
if ( ! defined( 'ABSPATH' ) ) exit;
define( 'ABSPATH', dirname(dirname(__FILE__)) . '/' );
define( 'WPINC', 'wp-includes' );
dirname is a PHP function that returns the path of the parent directory, and wp-includes is pretty self explanatory.
I would say ABSPATH is better because it's one of the first things WP loads and it also looks better:) But there is no real "right way" because they both work.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Bongvireak - Blogger Templates - Powered by Blogger - Designed by Johanes Djogan -