1 Replies - 995 Views - Last Post: 07 August 2012 - 02:01 PM Rate Topic: -----

#1 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

class not found

Posted 07 August 2012 - 01:42 PM

How do I access a class in wordpress?

"class WP_User" is in wp-includes folder,
my php is in wp-admin folder,

if I just do new WP_User($id), it says class not found. if I use "include" I would basically copy the whole thing over?
how do I do this?
Is This A Good Question/Topic? 0
  • +

Replies To: class not found

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3115
  • View blog
  • Posts: 4,675
  • Joined: 08-June 10

Re: class not found

Posted 07 August 2012 - 02:01 PM

I don't know about Wordpress specifically, but in general, to use a class in PHP the class definition must be included first.

If you know where you class file is, and Wordpress doesn't have an autoloader set to load it automatically, then you could simply "include" the file.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1