*/ class Atr_Advanced_Menu_Walker_Edit_Fields { // Load API for media loader function atr_am_load_wp_media_files() { // Check if wp_enqueue_media is already loaded. (Otherwise, media will not worl on posts/pages edit) if ( did_action( 'wp_enqueue_media' ) ) { return; } else { wp_enqueue_media(); } } //$this->loader->add_action('load_wp_media_files', $plugin_edit_menu_fields, 'atr_am_load_wp_media_files', 11, 4); //add_action('load_wp_media_files', array($this->atr_am_load_wp_media_files()) 'atr_am_load_wp_media_files', 11, 4); /** * Add fields to hook added in Walker * This will allow us to play nicely with any other plugin that is adding the same hook * @params obj $item - the menu item * @params array $args * @since 1.0.0 */ public function custom_fields($item_id, $item, $depth, $args) { /* New fields insertion starts here */ ?>