Created
November 27, 2021 00:53
-
-
Save kwcjr/4f67635dac007abf53d1cebf7a5c0487 to your computer and use it in GitHub Desktop.
Delete WP readme.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Delete WP readme.html file remotely. | |
* | |
* This snippet will delete the readme.html file from your Child Site root dir. | |
* | |
* @snippetType: Return info from Child Site. | |
*/ | |
// Load in WP Core files we need. | |
include_once(ABSPATH . WPINC . '/functions.php'); | |
include_once(ABSPATH . WPINC . '/plugins.php'); | |
$file_path = ABSPATH . 'readme.html'; // path of the file which need to be deleted. | |
wp_delete_file( $file_path ); //delete file here. | |
echo 'File ' . $file_path . ' has been deleted.'; // Echo result to screen. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment