Ticket #17394: test-role.php
| File test-role.php, 460 bytes (added by , 15 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?php #/* |
| 2 | #Plugin Name: Test Role Plugin |
| 3 | #Description: Adds a single test role 'Test' to demo a WP bug |
| 4 | #Author: whiteatom |
| 5 | #Version: 1.0 |
| 6 | |
| 7 | register_activation_hook(__FILE__, 'create_role' ); // creates roles |
| 8 | register_deactivation_hook(__FILE__, 'delete_role' ); |
| 9 | |
| 10 | function create_role(){ |
| 11 | $editor = get_role('editor'); |
| 12 | $ed_caps = $editor->capabilities; |
| 13 | add_role('test-role', 'Test', $ed_caps); |
| 14 | } |
| 15 | |
| 16 | function delete_role(){ |
| 17 | remove_role('test-role'); |
| 18 | } |
| 19 | |
| 20 | ?> |
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)