Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Silence is golden, but I actually want people to view the website.
- */
- if ( ! defined( 'ABSPATH' ) ) {
- // Call dirname() 4 times as this file is in '/wp-contents/plugins/plugin-dir/' and wp-content.php is in '/'
- require_once dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/wp-config.php';
- // Permanent redirect home.
- wp_safe_redirect( home_url(), 301 );
- die;
- }
- define( 'ABSPATH', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/YOUR_PLUGIN_DIR/' );
- require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' );
Add Comment
Please, Sign In to add comment