Support » Plugin: Admin Page Framework » Add some HTML after validation (or submit)

  • Resolved philippenantes

    (@philippenantes)


    Hi,

    I basically want to display some HTML (and some javascript if possible) after admin user have submitted some fields in a section, included in a tab.

    I processed what I needed in the validation_foo_bar () function and everything is fine. I know I can set a success message with :
    $this->setSettingNotice( __( ‘Import done! ‘) ,’updated’);

    But I need to put some HTML in the section.

    Could you please point me in the right direction ? I was not able ton find/understand how to setup my callback function.

    Related question : I did not find how to add my magic on Submission, only on Validation function. It this a good/bad practice and how, if possible, may I put my code on “submission” function ?

    Thank you very much anyway for this great tool.
    Phil

    https://wordpress.org/plugins/admin-page-framework/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    You can use the setting_update_url_{class name} filter hook to embed a custom URL query key. Then check the query key to decide whether you display some text. I posted an example plugin on Gist. It is very short and you can see how I did.

    Related question : I did not find how to add my magic on Submission, only on Validation function. It this a good/bad practice and how, if possible, may I put my code on “submission” function ?

    Here you can find list of hooks. You may want to use the submit_{...} action hook. If your class name is MyAdminClass, the hook name will be submit_MyAdminClass and the pre-defined callback method name will be submit_MuAdminClass().

    Thread Starter philippenantes

    (@philippenantes)

    Thank you very much for your support 😉

    And for having taken the time to set up a working example.

    Kudos on this one

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add some HTML after validation (or submit)’ is closed to new replies.