Preethamp08
Forum Replies Created
-
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!!!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 118Code:
<?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?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.
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.