Using built-in WordPress functions in the functions.php file

[ad_1]

I am locally testing a php function which triggers when a file is uploaded to my website via a form submission. This function will ideally be added to the functions.php theme file and simply gets the file using the built-in WordPress get\_file() function. However, I receive a PHP fatal exception error: call to undefined function. I have tried importing this function into the functions.php file via the require\_once() function giving: $\_SERVER\[‘DOCUMENT\_ROOT’\] . ‘/wp-load.php’ however this doesn’t seem to work. Any help would be appreciated, thanks.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer