wordpress - Can't call classes if they are in another php file? -


i attempting call class in required file, getting error

php fatal error:  class 'sampleclass' not found in /home2/domain/public_html/website/v2/wp-content/plugins/myplugin.php on line 23 

i can tell file required correctly have echoed text in , displays. using wordpress - there weird wordpress prevent working?

as copied class original file (as opposed including somewhere else) works fine.

any ideas? can provide more info if needed, i'm opposed copying code here because irrelevant.

to use class have prefix class name namespace example:-

instead of:

new codebird;

you write:

new codebird\codebird;


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -