willcowd
Forum Replies Created
-
Forum: Plugins
In reply to: [Easy Testimonials] sortingAwesome update Richard!!
Forum: Plugins
In reply to: Custom plugin capability issueAny help would be great ??
Forum: Fixing WordPress
In reply to: header.php not using phpHi alcymyth
I’ve tried that with no luck I’m afraid.
Thanks
MarkForum: Plugins
In reply to: MU-Plugin get user infoHi All
I managed to get there in the end. This is the code, just in case it helps someone.
function check_if_user_needs_redirecting(){ $active_blog = get_active_blog_for_user(get_current_user_id()); $blogid = get_current_blog_id(); if ($blogid != $active_blog->blog_id){ header('Location: '.$active_blog->siteurl.'/wp-admin/'); exit; } } add_action( 'init', 'check_if_user_needs_redirecting' );
Forum: Fixing WordPress
In reply to: Get current user for pluginFound the answer!!
I was running things in the wrong order. In the end, this function worked:
function get_user(){ global $current_user; print_r($current_user); } add_action( 'admin_head', 'get_user' );
This makes sure things are done in the correct order.
Thanks Chris for your help
Forum: Fixing WordPress
In reply to: Get current user for pluginThat is a step forward, but I’m getting:
WP_User Object ( [data] => [ID] => 0 [caps] => Array ( ) [cap_key] => [roles] => Array ( ) [allcaps] => Array ( ) [filter] => )
From
require (ABSPATH . WPINC . '/pluggable.php'); if ( !function_exists('wp_get_current_user') ){ echo 'Function not set'; function wp_get_current_user() { global $current_user; get_currentuserinfo(); return $current_user; } } print_r(wp_get_current_user());
Forum: Fixing WordPress
In reply to: Get current user for pluginHi Chris
Sorry for the lack of information.
I am able to run functions including:add_action(‘media_buttons_context’, ‘add_my_custom_button’);
add_filter( ‘mce_css’, ‘filter_mce_css’ );If I add in require_once( ABSPATH . ‘wp-blog-header.php’); i get
Fatal error: Call to a member function main() on a non-object in /home/willcowd/public_html/wp-includes/functions.php on line 798
…which I would expect.
$user = get_currentuserinfo(); echo $user;
returns
Fatal error: Call to undefined function get_currentuserinfo() in /home/willcowd/public_html/wp-content/mu-plugins/custom-functions.php on line 16
I hope this explains it.
Thanks
MarkForum: Plugins
In reply to: MU-Plugin get user infoHi All
I’ve added in
require_once( ABSPATH . ‘wp-blog-header.php’);
but as I thought it gives a fatal error
Fatal error: Call to a member function main() on a non-object in /home/willcowd/public_html/wp-includes/functions.php on line 798
Any ideas would be great.
Forum: Plugins
In reply to: MU-Plugin get user infoHi all
I’m very sorry to bump this, but I could really so with some help.
Thanks
MarkForum: Fixing WordPress
In reply to: DIV's getting added by editorIt’s not the ideal thing to have the block elements but the class being added is the true problem as it breaks twitter bootstrap
Forum: Fixing WordPress
In reply to: DIV's getting added by editorHi Andrew.
Nothing, clean 2014 install running 3.8
Thanks
MarkForum: Fixing WordPress
In reply to: DIV's getting added by editorHi Andrew
Thank you for the reply but I can see it happening in the visual editor as I’m doing it. (I have a dotted border around the divs)
Thanks
Mark