1

I use the http://www.deluxeblogtips.com/meta-box Metabox plugin and I want to add a custom action in a post type like the publish button ? when admin click on this button I want to send an email to the author and delete the current post type.

I have added the button in my post like this :

    // meta box
    $meta_boxes[] = array(
            'title' => __('Reviewer','sparta'),
            'pages' => array( 'download'),
            'fields' => array(
                array(
            'name' => __('Reject','sparta'),
            'desc' => __('reject this                  post.','sparta'),
                      'id' => $prefix . 'reject_post',
                      'type' => 'button',
                      'std' => ''
                )));

My question is how to execute my action from this button ? someone has an idea ?

Thank you very much

  • 1
    What happens when you click the button? Does the form submit? Are you hoping to do this via AJAX? Please clarify. – s_ha_dum Feb 3 '14 at 14:18
  • when i hit the button no things happen, here the code for the button field : github.com/rilwis/meta-box/blob/master/inc/fields/button.php – Abdeel Feb 3 '14 at 21:21
  • Is the generated markup for the button correct? – s_ha_dum Feb 3 '14 at 21:22
  • yes it is :<div class="rwmb-input"><a href="#" id="wp_author_reject" class="button hide-if-no-js">Click me</a></div> – Abdeel Feb 3 '14 at 21:34
  • That "button" isn't really a button. It is a link and it looks like it is intended to operate via Javascript. – s_ha_dum Feb 3 '14 at 22:30
-1

I found this solution here: WP plugin that add a button to post edit page that allow sending a notify to a contributor whose a post was not approved. It's possible customize the message including the reason for rejected approval.

https://github.com/Giuseppe-Mazzapica/GMRejectNotify

I have not tested it but it seems legit!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.