Site icon Hip-Hop Website Design and Development

How one can add picture uploader to a customized widget?

I’v constructed a customized widget that may present some sport scores. Scores are added trough customized publish. When i open new customized publish(scores) i enter their staff names, rating, scores. Now i wish to add an choice to point out staff logos subsequent to the staff title. Within the final couple of days each tutorial right here and elsewhere i may discover didnt labored. I don’t know why, as i’m beginner with all this. With a lot of it, add button seems however the pop as much as selected/add picture doesnt seem. Now I may publish at the very least 10 hyperlinks the place i discovered this codes however i consider there’s a restrict with hyperlink. So for an instance that is most typical tutorial i’ve discovered.

Right here

The final one. Now on this case i’m not positive about few issues.

add_action('admin_enqueue_scripts', 'my_admin_scripts');

perform my_admin_scripts() {
    if (isset($_GET['page']) && $_GET['page'] == 'my_plugin_page') {
        wp_enqueue_media();
        wp_register_script('my-admin-js', WP_PLUGIN_URL.'/my-plugin/my-admin.js', array('jquery'));
        wp_enqueue_script('my-admin-js');
    }
}

what precisely is that this ‘my_plugin_page’ i assume i’m doing one thing mistaken and that is why uploader doesnt pop up. What i would like so as to add as a substitute of it, any instance?

Inside my theme i’v made a brand new folder known as my-plugin inside which i added my-admin.js with the script code from the hyperlink above.

I additionally tried different means with out it could possibly calling the script by get_template_directory_uri().

Any assist pls.