Friday, May 17, 2024
HomeWordPress Developmentplugin improvement - Settle for solely PDF file for add

plugin improvement – Settle for solely PDF file for add


After I initially use the MediaUpload element and I select to add a picture, it solely lets me add a PDF and all different recordsdata sorts in my laptop file supervisor are greyed out. That is good. Nonetheless once I wish to change all of it file sorts can be found to select from despite the fact that I’ve specified the mime sort software/pdf.

          {!pdfUrl && (
            <MediaPlaceholder
              worth={pdfID}
              labels={{ title: "PDF" }}
              onSelect={onPdfSelect}
              settle for=".pdf"
            />
          )}
          {pdfUrl && (
            <MediaUploadCheck>
              <MediaUpload
                onSelect={onPdfSelect}
                allowedTypes={['application/pdf']}
                worth={pdfID}
                settle for=".pdf"
                render={({ open }) => (
                  <IconButton
                    className="components-toolbar__control"
                    label="Substitute PDF"
                    icon="edit"
                    onClick={open}
                  />
                )}
              />
            </MediaUploadCheck>
          )}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments