I have some troubles to include a file called myplugin_functions.php
This php file contains functions that are required to make some functions work in the wordpress admin area. For that reason I include this file in backend pages using:
include( plugin_dir_path( __FILE__ ) . 'myplugin_functions.php');
This works perfectly.
When I do the same thing on frontend pages, the frontend can access these functions. Great.
But when I then navigate to the backend I get an error message
Fatal error: Cannot redeclare myfunction() (previously declared in /www/htdocs/...) in /www/htdocs/..../myplugin_functions.php on line 28
include_once() makes the problem vanish. But I think wordpress doesn't like including the same php functions for frontend and backend.
Do you know why? What is the best practice to get around this?
Thank you?