[Admin Menu WP] Agregar menu en administrador de wordpress (side menu) #wordpress #admin #php
<?php
function mail_actions_admin_menu() {
add_menu_page(
'Mail actions',
'Mail Actions',
'manage_options',
'mail-actions/mail-actions-admin-page.php',
'mail_actions_admin_page',
'dashicons-email-alt',
106);
}
add_action( 'admin_menu', 'mail_actions_admin_menu' );
function mail_actions_admin_page(){ ?>
<div class="wrap">
<h2>Mail Actions</h2>
<table class="form-table">
<tbody>
<tr>
<th scope="row"><label for="send-announcement">Send Announcement (all CEO'S)</label></th>
<td>
<input type="button" id="send-announcement" class="button button-primary" value="Send Announcement" onClick="sendMailing('/sendAnnouncement', this)">
<span id="send-announcement-response" class="mail-actions-response-message"></span>
</td>
</tr>
<tr>
<th scope="row"><label for="send-invite">Send Invite (all CEO'S)</label></th>
<td>
<input type="button" id="send-invite" class="button button-primary" value="Send Invite" onClick="sendMailing('/sendInvite', this)">
<span id="send-invite-response" class="mail-actions-response-message"></span>
</td>
</tr>
<tr>
<th scope="row"><label for="send-reminder">Send Reminder (pending CEO'S)</label></th>
<td>
<input type="button" id="send-reminder" class="button button-primary" value="Send Reminder" onClick="sendMailing('/sendInviteReminder', this)">
<span id="send-reminder-response" class="mail-actions-response-message"></span>
</td>
</tr>
</tbody>
</table>
</div>
<?php }