Created
December 30, 2015 21:36
-
-
Save mckernanin/d6246794362c0f56ace3 to your computer and use it in GitHub Desktop.
Conditional link in admin bar, based on site URL private Add new snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function migrate_db_admin_bar($wp_admin_bar){ | |
$args = array( | |
'id' => 'wp-migrate-db-pro', | |
'title' => 'Migrate DB Pro', | |
'href' => '/wp-admin/tools.php?page=wp-migrate-db-pro', | |
'meta' => array( | |
'class' => 'wp-migrate-db-pro-button' | |
) | |
); | |
if (strpos(site_url(), 'stage')) { | |
$wp_admin_bar->add_node($args); | |
} | |
if (strpos(site_url(), '.dev')) { | |
$wp_admin_bar->add_node($args); | |
} | |
} | |
add_action('admin_bar_menu', 'migrate_db_admin_bar', 50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment