简体   繁体   中英

Require or Include PHP class : can't access functions

I am working on a Wordpress-based site. I'm trying to include a PHP class, and seem to have success, though I can't use the functions within the class (functions are not recognized).

Note: I'm including the class inline via a custom template page within my WP theme.

Try to instantiate the class first, then access the function through your variable

$a = new Class();
$a->function();

But some functions are private, read the documentation of the class first..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM