WordPress 3.1 a adaugat o bara atunci cand esti pe blog sa poti ajunge in mai multe zone ale blogului. Aceasta bara poate fi customizata si se pot adauga noi optiuni pe ea.
Urmatorul cod adauga linkuri in bara de admin:
[php]
function pbd_admin_bar_links() {
global $wp_admin_bar;

// Build Twitter Reactions link.
$url = 'https://'. $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$twitter = 'https://search.twitter.com/search?q='. urlencode($url);

// Aici trebuie sa adaugati alte linkuri
$links = array(
'Dexblog' => 'https://www.dexblog.ro/',
'Twitter Reactions' => $twitter,
'Google Analytics' => 'https://www.google.com/analytics/',
'Webmaster Tools' => 'https://www.google.com/webmasters/tools/dashboard'
);
$wp_admin_bar->add_menu( array(
'title' => 'Stats',
'href' => false,
'id' => 'pbd_links',
'href' => false
));

/**
* Add the submenu links.
*/
foreach ($links as $label => $url) {
$wp_admin_bar->add_menu( array(
'title' => $label,
'href' => $url,
'parent' => 'pbd_links',
'meta' => array('target' => '_blank')
));
} }
add_action('admin_bar_menu', 'pbd_admin_bar_links',500);
[/php]

LĂSAȚI UN MESAJ

Please enter your comment!
Please enter your name here