Title: Preethamp08's Replies | WordPress.org

---

# Preethamp08

  [  ](https://wordpress.org/support/users/preethamp08/)

 *   [Profile](https://wordpress.org/support/users/preethamp08/)
 *   [Topics Started](https://wordpress.org/support/users/preethamp08/topics/)
 *   [Replies Created](https://wordpress.org/support/users/preethamp08/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/preethamp08/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/preethamp08/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/preethamp08/engagements/)
 *   [Favorites](https://wordpress.org/support/users/preethamp08/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] API usage in different plugin](https://wordpress.org/support/topic/api-usage-in-different-plugin/)
 *  Thread Starter [Preethamp08](https://wordpress.org/support/users/preethamp08/)
 * (@preethamp08)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/api-usage-in-different-plugin/#post-5392470)
 * Thanks for guiding me through this.
    I tried the below snippet and it worked!!
 * <?php
    require_once(‘../../../wp-load.php’); require_once(ABSPATH.’wp-includes/
   pluggable.php’);
 * $current_user = wp_get_current_user();
    $usr_name = $current_user->user_login;?
   >
 * Thanks again
    Cheers!!!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] API usage in different plugin](https://wordpress.org/support/topic/api-usage-in-different-plugin/)
 *  Thread Starter [Preethamp08](https://wordpress.org/support/users/preethamp08/)
 * (@preethamp08)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/api-usage-in-different-plugin/#post-5392453)
 * Krumch,
 * I googled few articles and basics of usage and I’m stuck at this place
    Error:
   Fatal error: Call to undefined function apply_filters() in C:\wamp\www\wordpress\
   wp-includes\pluggable.php on line 118
 * Code:
    <?php include ‘C:\wamp\www\wordpress\wp-includes\pluggable.php’;
 * $current_user = wp_get_current_user();
 * echo ‘Username: ‘ . $current_user->user_login;
    ?>
 * I haven’t modified pluggable.php file.
    Am I still missing any include or require
   file?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] API usage in different plugin](https://wordpress.org/support/topic/api-usage-in-different-plugin/)
 *  Thread Starter [Preethamp08](https://wordpress.org/support/users/preethamp08/)
 * (@preethamp08)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/api-usage-in-different-plugin/#post-5392394)
 * I have a plugin implemented where I need to use the logged in user name.
    I have
   added s2 member to WP and went through the API’s supported. So i thought i can
   use these in my plugin.
 * I’m new to WP and PHP, kindly bear with me if I have missed the basics.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions] API usage in different plugin](https://wordpress.org/support/topic/api-usage-in-different-plugin/)
 *  Thread Starter [Preethamp08](https://wordpress.org/support/users/preethamp08/)
 * (@preethamp08)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/api-usage-in-different-plugin/#post-5392376)
 * Thanks for the reply Krumch, I tried the above suggestion but this time the error
   was for do_shortcode function. Error: ‘Fatal error: Call to undefined function
   do_shortcode()’.
 * Here is the code I have used:
 * <? php
    $user_id = do_shortcode(‘[s2Get user_field=”user_login” /]’); ?>
 * PS: I have used this code in one of the php file in a custom plugin.

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