• Resolved furi3r

    (@furi3r)


    Hello, we are getting warnings every time the media library is accessed on “Grid” mode.

    Debugging further I’ve realized where the bug is introduced.

    $args is lost after get_media_item_args is called, and the warning happens when next lines try to access $args[‘in_modal’]

    /** This filter is documented in wp-admin/includes/media.php */
    	$args = apply_filters( 'get_media_item_args', $args );

    in init.php, line 582, you introduce a filter:

    // Force 'Insert into Post' button from Media Library.
    add_filter( 'get_media_item_args', 'bsf_force_send' );
    function bsf_force_send( $args ) {
    
    	if ( ! isset( $_GET['bsf_file_upload_nonce'] ) || ! wp_verify_nonce( $_GET['bsf_file_upload_nonce'], 'ajax_nonce' ) ) {
    		return ; // <- Here is the bug, you should return $args
    	}

    The plugin is breaking the filter, returning nothing instead of returning the original $args.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warning on media library’ is closed to new replies.