Created
September 14, 2023 08:14
-
-
Save jonathanbossenger/41391ce7329a9290215ca7528f35b6b2 to your computer and use it in GitHub Desktop.
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
<?php | |
/** | |
* Plugin Name: WP Learn HTTP API | |
* Description: Learning about the WP HTTP API | |
* Version: 0.0.1 | |
*/ | |
/** | |
* Create an admin page to show the API data | |
*/ | |
add_action( 'admin_menu', 'wp_learn_http_submenu', 11 ); | |
function wp_learn_http_submenu() { | |
add_menu_page( | |
esc_html__( 'WP Learn HTTP', 'wp_learn' ), | |
esc_html__( 'WP Learn HTTP', 'wp_learn' ), | |
'manage_options', | |
'wp_learn_admin', | |
'wp_learn_render_http_admin_page', | |
'dashicons-admin-tools' | |
); | |
} | |
/** | |
* Render the admin page | |
*/ | |
function wp_learn_render_http_admin_page(){ | |
?> | |
<div class="wrap" id="wp_learn_admin"> | |
<h1>Products</h1> | |
</div> | |
<?php | |
do_action('wp_learn_load_products_hook'); | |
} | |
/** | |
* Load the data from the API | |
*/ | |
add_action( 'wp_learn_load_products_hook', 'wp_learn_products_data' ); | |
function wp_learn_products_data(){ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment