• Hi everyone,
    I’ve been looking in different forums how to edit the “Submit for review” button functionality and I found nothing. I tested a hook named “post_submitbox_misc_actions” but it didn’t work, then I read it only works for classic editor, not for Gutenberg.

    Thank you very much!
    Lucas.

    • This topic was modified 5 years, 2 months ago by lucascerliani.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    In what way do you want to change its functionality? The button submits the edit screen content to the server for processing. This must happen in some manner. If you change its functionality, how does the data get submitted?

    I will say that altering it in PHP is unlikely, your best bet would be JavaScript or jQuery.

    Thread Starter lucascerliani

    (@lucascerliani)

    What I really want to do is adding functionality to that button. For example, I need to open a modal when I click on “Submit for review”, my problem is that I don’t even know where or how I can add code to that button.

    Thank you for your response and let me know if I explained wrongly.

    Moderator bcworkz

    (@bcworkz)

    You’ll need JavaScript or jQuery code which sets a click event listener on the button. The code that executes on click can put up a modal, collect user interaction, and ultimately submit the data if the proper interaction is collected. Or do anything else that’s possible with JavaScript.

    You get your code to load by calling wp_enqueue_script() from within a callback hooked to “admin_enqueue_script”. The PHP enqueue code can reside in functions.php of your theme, or preferably a child theme or a simple custom plugin.

    Thread Starter lucascerliani

    (@lucascerliani)

    Ok, I understand and it looks easy, but I’m missing something, how can I access the button if it isn’t by its id? I’ve tried accessing by its classes but it didn’t work.

    Thank you again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to edit “Submit for review” button functionality’ is closed to new replies.