| 1 |
<?php namespace TierPricingTable\Addons\Tools; |
| 2 |
|
| 3 |
use TierPricingTable\Settings\Settings; |
| 4 |
|
| 5 |
class AdminUserHooks { |
| 6 |
|
| 7 |
public function __construct() { |
| 8 |
add_action( 'admin_footer-user-new.php', array( $this, 'addRolesManagementLink' ) ); |
| 9 |
add_action( 'admin_footer-user-edit.php', array( $this, 'addRolesManagementLink' ) ); |
| 10 |
} |
| 11 |
|
| 12 |
public function addRolesManagementLink() { |
| 13 |
|
| 14 |
$url = admin_url( 'admin.php?page=wc-settings&tab=' . Settings::SETTINGS_PAGE . '§ion=tools' ); |
| 15 |
$text = __( 'Manage Roles', 'tier-pricing-table' ); |
| 16 |
?> |
| 17 |
<script> |
| 18 |
jQuery(document).ready(function ($) { |
| 19 |
var $roleSelect = $('#role'); |
| 20 |
if ($roleSelect.length) { |
| 21 |
$roleSelect.after(' <a href="<?php echo esc_url( $url ); ?>" style="display: inline-block; margin-left: 5px;"><?php echo esc_html( $text ); ?></a>'); |
| 22 |
} |
| 23 |
}); |
| 24 |
</script> |
| 25 |
<?php |
| 26 |
} |
| 27 |
} |
| 28 |
|