Running rmdir function on post save

Add this to your theme’s functions.php file: function wpse202681_save_post_action($post_id, $post_object, $update) { $folder = “/temp/files/”; delFolder($folder); } add_action( ‘save_post’, ‘wpse202681_save_post_action’, 10, 3 ); // + delFolder() function definition You will probably have to alter folder paths depending on your /temp/files/ location. This will execute everytime any post is saved. You can restrict it to only … Read more

How to edit php code in WordPress Post file?

You should never ever modify WordPress Core files. WordPress has an Plugin API (http://codex.wordpress.org/Plugin_API) that allows you to modify WordPress to your liking without changing Core code. In your case, the solution is to check the contents of the custom meta box fields before they are saved via the save_post action. If the content is … Read more

Can WP plugins access files outside the installation folder?

Can they theoretically develop a WP plugin to access the files (or even WP config, including DB credentials) of another WP installation? Yes. If your folders are owned by the same user, run as the same user in Apache/Nginx or have read/write access to each other, then it’s possible. Your installations are sandboxed at the … Read more