queue: "); console_log($wp_scripts->queue); return $html_front; } add_shortcode('wp_model_plugin', 'main_shortcode'); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * menu plugin */ function plugin_menu() { add_menu_page( 'wp model plugin', // webpage title 'model plugin', // menu title 'manage_options', // capability 'wp-model-plugin', // menu_slug 'wp_model_plugin_content' // callback function to display page content ); } add_action('admin_menu', 'plugin_menu'); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ajax - https://stackoverflow.com/questions/43557755/how-to-call-ajax-in-wordpress - in `add_action( 'wp_ajax_get_data', 'my_ajax_handler' );` the 'wp_ajax_get_data' is a hooks formated as 'wp_ajax_{$action}' the `$action` param is passed in the data object of the ajax call - to access the content of the data object properties of the ajax call : use $_POST['property_name'] */ function my_ajax_handler() { wp_send_json_success( array( 'It works', "data_received" => $_POST['data'], ), 200 ); } add_action( 'wp_ajax_get_data', 'my_ajax_handler' ); ?>