Title: Problem with function now in class
Last modified: August 31, 2016

---

# Problem with function now in class

 *  Resolved [Tim](https://wordpress.org/support/users/timwakeling-1/)
 * (@timwakeling-1)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/problem-with-function-now-in-class/)
 * Hi
 * Great job putting the code into a class – the right thing to do. 🙂
 * However my site was using the PHP call to the function, like this:
    echo pplb_logout_button();
 * After updating your plugin I got PHP errors that the function was not found, 
   so I had to change my code to this:
    $pplb = new PPLB_Plugin(); echo $pplb->pplb_logout_button();
 * You might want to update your advice on the settings page and/or provide a backup
   function so that users like me don’t get struck with PHP fatal errors.
 * Thanks for the plugin though – nice work 🙂
 * Tim
 * [https://wordpress.org/plugins/protected-posts-logout-button/](https://wordpress.org/plugins/protected-posts-logout-button/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Nate Reist](https://wordpress.org/support/users/natereist/)
 * (@natereist)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/problem-with-function-now-in-class/#post-7260574)
 * Hey Tim,
 * Sorry about that! I patched the plugin to include that function again and made
   it just call the shortcode, so that it doesn’t need to create a new instance 
   of that class. Thanks for the heads up!
 * Nate
 *  Thread Starter [Tim](https://wordpress.org/support/users/timwakeling-1/)
 * (@timwakeling-1)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/problem-with-function-now-in-class/#post-7260589)
 * That was quick – thanks! 🙂
 *  [Jorge del Campo Andrade](https://wordpress.org/support/users/jorgedelcampo/)
 * (@jorgedelcampo)
 * [10 years ago](https://wordpress.org/support/topic/problem-with-function-now-in-class/#post-7260817)
 * Hi Nate,
 * I’ve installed the plugin but the button don’t logout. When i press it i’m still
   login.
 * I ‘ve include the code on my header.php file but don’t works
 * Can you help me?
    Regards from Chile!
 *  Thread Starter [Tim](https://wordpress.org/support/users/timwakeling-1/)
 * (@timwakeling-1)
 * [10 years ago](https://wordpress.org/support/topic/problem-with-function-now-in-class/#post-7260818)
 * You’ll need to post a new topic, jorgedelcampo, as this one is marked “resolved”
   and you have a different problem. 🙂
 * [https://wordpress.org/support/plugin/protected-posts-logout-button](https://wordpress.org/support/plugin/protected-posts-logout-button)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Problem with function now in class’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/protected-posts-logout-button.svg)
 * [Protected Posts Logout Button](https://wordpress.org/plugins/protected-posts-logout-button/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/protected-posts-logout-button/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/protected-posts-logout-button/)
 * [Active Topics](https://wordpress.org/support/plugin/protected-posts-logout-button/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/protected-posts-logout-button/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/protected-posts-logout-button/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Tim](https://wordpress.org/support/users/timwakeling-1/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/problem-with-function-now-in-class/#post-7260818)
 * Status: resolved