$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>wordpress plugin php file processing form|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

wordpress plugin php file processing form

matteradmin8PV0评论

i try to analyse a plugin operations , and , at some point we fill a form to be process , but i don't know by who the form is processed as i have this kind of html form , so i wonder how i can know the final php file who handle realy my form.

  <form method="post" action="<?php echo esc_url( admin_url( 'admin- 
      post.php' ) ); ?>">
        <input type="hidden" name="action" value="check_imported">
        <input type="hidden" name="importer" value="<?php echo esc_attr( 
        $uid ); ?>">
        <?php wp_nonce_field( 'check_imported', 'check_imported', false ); 
          ?>
        <table class="import">

thank you for your help.

i try to analyse a plugin operations , and , at some point we fill a form to be process , but i don't know by who the form is processed as i have this kind of html form , so i wonder how i can know the final php file who handle realy my form.

  <form method="post" action="<?php echo esc_url( admin_url( 'admin- 
      post.php' ) ); ?>">
        <input type="hidden" name="action" value="check_imported">
        <input type="hidden" name="importer" value="<?php echo esc_attr( 
        $uid ); ?>">
        <?php wp_nonce_field( 'check_imported', 'check_imported', false ); 
          ?>
        <table class="import">

thank you for your help.

Share Improve this question asked Mar 13, 2019 at 13:11 alpha.romeoalpha.romeo 491 gold badge1 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

The form action is the file that handles the form, which you can see is the admin-post.php file in your WordPress installation.

However what you are really looking for is the hook that handles the form.

Basically, the form is getting submitted to admin-post.php, which then uses the "action" value in your form to determine what hook to trigger; in other words, what code to run. This is a common WordPress paradigm.

The hook name is generated in this format:

admin_post_{{action}} for logged in users, and admin_post_nopriv_{{action}} for non-logged in users

In your case the action is set to "check_imported". So if you are trying to find code that is already handling these, do a search in your theme/plugins for "admin_post_check_imported" and/or "admin_post_nopriv_check_imported".

They would be written as an add_action call, connecting the hook name to some other function, like:

add_action( 'admin_post_check_imported', 'some_function_name');

So you would then look for the function named, "some_function_name", for the actual code.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far