[wp-trac] [WordPress Trac] #39974: Grid Mode Doesn't Load Files - Infinite Loading
WordPress Trac
noreply at wordpress.org
Mon Feb 27 14:57:21 UTC 2017
#39974: Grid Mode Doesn't Load Files - Infinite Loading
--------------------------------+-----------------------------
Reporter: Peter Westerlund | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.7.2
Severity: normal | Keywords:
Focuses: ui, administration |
--------------------------------+-----------------------------
In Admin > Media Library, files won't load when viewing in grid mode. But
is showing in list mode.
- I have tried re-installing Wordpress except /wp-content and wp-
config.php. Did not helped.
- Have activated wp_debug, but couldn't see any related errors
- Have tried removing all the code from functions.php
- Have tried activate another theme
Nothing is helping. I suspect something has got into the database and
destroying this functionality.
A moment before this happened I were adding this code to function.php:
{{{#!php
<?php
function save_nb_image()
{
global $wpdb;
$id = $_POST['id'];
$file = wp_get_attachment_url($id);
if ( !is_wp_error($id) )
{
$meta = wp_generate_attachment_metadata($id, $file);
$meta = nb_image_crop($meta);
wp_update_attachment_metadata($id, $meta);
}
wp_die();
}
add_action( 'wp_ajax_nb-image-autofix', 'save_nb_image' );
}}}
And then clicking on the "Autofix" button. I have later found out that
wp_get_attachment_url() wasn't the right function to use. That outputted a
lot of code that I suspect is the image in code format. The right function
to use is get_attached_file(). However, the Media Library Grid Mode is
still not working.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39974>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list