I started working on a cool new plugin that allows you to post content to multiple WordPress sites. It has a simple and clean interface. The plugin adds a very convenient link to the top WP admin bar. Below is the code I used to create this easy to access menu. wordpress plugin orbisius just write top wp admin bar Related

[code]

$orb_just_write_admin_obj = orb_just_write_admin::get_instance();
add_action('wp_before_admin_bar_render', array($orb_just_write_admin_obj, "add2admin_bar") );

/**
* Description of admin
*
* @author User
*/
class orb_just_write_admin {
public function add2admin_bar() {
global $wp_admin_bar;

$icon_url = ORBISIUS_JUST_WRITE_URL . 'modules/images/icon.png';

$wp_admin_bar->add_node(array(
'id' => __CLASS__ . '-toolbar',
'title' => "<img style='vertical-align:middle;' alt='' src='$icon_url' /> " . ORBISIUS_JUST_WRITE_PLUGIN_NAME,
'href' => site_url('/?orbisius_just_write'),
'meta' => array(
"class" => __CLASS__ . '-toolbar',
'target' => '_blank',
),
));
}

/**
* Singleton pattern i.e. we have only one instance of this obj
*
* @staticvar type $instance
* @return \cls
*/
public static function get_instance() {
static $instance = null;

if (is_null($instance)) {
$cls = __CLASS__;
$instance = new $cls();
}

return $instance;
}
[/code]

Disclaimer: The content in this post is for educational purposes only. Always remember to take a backup before doing any of the suggested steps just to be on the safe side.
Referral Note: When you purchase through a referral link (if any) on this page, we may earn a commission.
If you're feeling thankful, you can buy me a coffee or a beer