T
T
TravaUDoma2021-10-15 08:06:59
PHP
TravaUDoma, 2021-10-15 08:06:59

How to insert third party php code into admin page?

All the best.
I have a php code that renders a page with a file manager, I'm trying to make a page out of it in the admin panel

<?php
add_action( 'admin_menu', 'custom_php' );
function custom_php() {
    add_menu_page( 
        'custom_php_display_page' 
    );
}

function custom_php_display_page() {
 //custom_php_code
}

Naturally, this does not work
. Is there a universal method for inserting third-party code into wordpress?
if anyone is interested, the code itself is here

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-10-15
@TravaUDoma

Probably, this code will have to be divided: insert the layout of forms and tables into the body of the created page in add_menu_page(), connect php handlers and functions in functions.php , and connect js scripts on the hook admin_enqueue_scripts. It's better to put it all in a separate plugin.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question