Support » Plugin: Frontier Restrict Media » fix critical conflict with oxigen builder

  • hi on frontier-restrict-media.php file i add a line that fix critical conflict with oxygen Builder

    replace

    //Check if it is an admin query
    	if ($query->is_admin && !current_user_can( 'edit_others_posts' ))
    		{
    		//Check if it is an attachment query
    		if ($query->query['post_type'] === 'attachment')
    			{
    			// Get current user, and author=current user to query
    			$current_user = wp_get_current_user();
    			$query->set('author', $current_user->ID);
    			}
    		}
    	return $query;

    with this

    //Check if it is an admin query
        if(!function_exists('wp_get_current_user')) { include(ABSPATH . "wp-includes/pluggable.php"); } // ALNUX ADD LINE
    	if ($query->is_admin && !current_user_can( 'edit_others_posts' ))
    		{
    		//Check if it is an attachment query
    		if ($query->query['post_type'] === 'attachment')
    			{
    			// Get current user, and author=current user to query
    			$current_user = wp_get_current_user();
    			$query->set('author', $current_user->ID);
    			}
    		}
    	return $query;

    this will fix critical error

  • You must be logged in to reply to this topic.