Created
October 31, 2020 18:05
-
-
Save Kristjan-Reinsberg/add79724408e743c9e3351493fd4a897 to your computer and use it in GitHub Desktop.
WP PLUGIN HOW TO ADD EDIT PAGE (as request parameter for X plugin page)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # NB! DO NOT USE add_page or add_sub_page for that | |
| # EXAMPLE: just use plugin main page and add request parameters | |
| global $wp; | |
| $query = add_query_arg( admin_url() , $wp->query_vars ); | |
| $edit_query = add_query_arg( array( | |
| 'page' => "plugin-page-home", | |
| 'car_id' => $car->id, | |
| 'work_id' => $work->id | |
| ), $query ); | |
| ?> | |
| <a class="btn btn-sm btn-warning" href="<?php echo $edit_query; ?>">Edit</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment