• I have added a custom variable to the wp-includes/vars.php file. What is the best way to avoid overwriting this code in future updates of WordPress.

Viewing 1 replies (of 1 total)
  • The only future-proof way to ensure that variable is not over-written in the future is to remove it from that file and place it outside of any WordPress core file. Making edits to core files is jsut bad and will lead to your edits being removed as soon as that file is updated – and unless you give up updating there’s nothing that you can do about that.

    The best way to add in a “custom” variable is to set it up in your theme (use a child theme if you’re eidting an existing theme) or in a plugin. That way it will be secure and it won’t get over-written on any future updates.

Viewing 1 replies (of 1 total)

The topic ‘How to 'Future Proof' a Custom Variable’ is closed to new replies.