• 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)
  • deepakl

    (@deepakl)

    Hi @furi3r ,

    Thanks for your question. I am not sure why this happens. Would you mind creating a ticket through the plugin so that we can debug that? Here is the screenshot that would help.

    • This reply was modified 2 years ago by deepakl.
    • This reply was modified 2 years ago by Jan Dembowski.
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @deepakl Do not use short links in these forums, that has been abused in the past and is expanded when found. I have expanded yours.

    deepakl

    (@deepakl)

    Hi @jdembowski,

    Thanks for the heads up! Noted!

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