julha
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Hello, indeed the update resolved the issue.
Thx for your reactivity.
Hello,
I found the error.
The error appeared on the default Site Icon field of my theme customizer.There is a conflict between
/wp-admin/includes/media.php
> function get_compat_media_markup()
>> apply_filters(‘attachment_fields_to_edit’)And
/wp-content/plugins/filebird/includes/class-filebird-topbar.php
> add_filter(‘attachment_fields_to_edit’)
>> function get_compat_media_markup()The function currently return an empty field that is making the error.
public function filebird_attachment_fields_to_edit($form_fields, $post) { // $dropdown_options = array( // 'show_option_all' => '- ' . __("Select", NJT_FILEBIRD_TEXT_DOMAIN) . ' -', // 'taxonomy' => NJT_FILEBIRD_FOLDER, // 'name'=> 'attachments[' . $post->ID . ']['.NJT_FILEBIRD_FOLDER.']' , // 'hide_empty' => false, // 'hierarchical' => true, // 'meta_key' => 'folder_position', // 'orderby' => 'meta_value', // 'show_count' => true, // 'walker' => new Walker_CategoryDropdown(), // 'value' => 'id', // 'echo' => false // ); // $terms = wp_get_post_terms( $post->ID, NJT_FILEBIRD_FOLDER ); // if(count($terms)){ // $dropdown_options['selected'] = $terms[0]->term_id; // } // $attachment_terms = wp_dropdown_categories( $dropdown_options ); // $form_fields[NJT_FILEBIRD_FOLDER] = array( // 'label' => __('Folder', NJT_FILEBIRD_TEXT_DOMAIN), // 'input' => 'html', // 'html' => // '<div class="njt-filebird-folder-edit">' // . $attachment_terms . // '</div>', // ); $form_fields[NJT_FILEBIRD_FOLDER] = []; return $form_fields; }
For those who can’t wait the plugin update, here is my hack to prevent the customizer from crashing:
add_filter('attachment_fields_to_edit', function ($form_fields) { unset($form_fields[NJT_FILEBIRD_FOLDER]); return $form_fields; });
- This reply was modified 5 years, 7 months ago by julha.
Viewing 2 replies - 1 through 2 (of 2 total)