I'm inside a data-centered system where I don't have much output and I need to know if I can write a file to a directory using the WP_Filesystem. Problem is, the request_filesystem_credentials outputs a form UNLESS we define FS_METHOD as direct.

But what if the direct method doesn't work? Then we need to fall-back on FTP and I'd like to output this form wherever I choose without request_filesystem_credentials outputting on check.

I'd like to avoid ob_get_contents if possible.

In short, I'm searching for a way to see if I need the form provided by request_filesystem_credentials before outputting it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.