• Resolved Vladimir Vasilenko

    (@jeltoesolnce)


    Hello, I set render function for mys custom field as a class method. I want to set classes_cb function as a method for the same class, what I can do? Have there some right way?

    Best regards,
    Vladimir.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    instead of just referencing it like this or so: 'classes_cb' => 'myfunc' you’re going to want to do something like 'classes_cb' => array( $this, 'myfunc' ). Similar to how you add hooks within the php class if you do that sometimes. Alternatively if you’re on PHP 5.4 or higher, you could abbreviate that down to [ $this, 'myfunc' ] and use the array shorthand if you want.

    Thread Starter Vladimir Vasilenko

    (@jeltoesolnce)

    Thanks, Michael)

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I point a callback function if it live inside class?’ is closed to new replies.