WordPress.org

Make WordPress Core

Ticket #38195: 38195.diff

File 38195.diff, 4.5 KB (added by zodiac1978, 3 years ago)

Proof of concept

  • src/wp-includes/post.php

     
    22752275 * @return array List of post mime types.
    22762276 */
    22772277function get_post_mime_types() {
     2278
     2279        // Misc application doc formats
     2280        $doc_mime_types  = 'application/pdf,application/rtf';
     2281        // Text doc formats
     2282        $doc_mime_types .= ',text/plain,text/richtext';
     2283        // WordPerfect doc formats
     2284        $doc_mime_types .= ',application/wordperfect';
     2285        // OpenOffice doc formats
     2286        $doc_mime_types .= ',application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.database,application/vnd.oasis.opendocument.formula,application/vnd.oasis.opendocument.chart';
     2287        // iWork doc formats
     2288        $doc_mime_types .= ',application/vnd.apple.pages';
     2289        // MS Office doc formats
     2290        $doc_mime_types .= 'application/msword,application/vnd.ms-write,application/onenote';
     2291        $doc_mime_types .= ',application/vnd.ms-access';
     2292        $doc_mime_types .= ',application/vnd.ms-project,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-word.document.macroEnabled.12,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vnd.ms-word.template.macroEnabled.12';
     2293
     2294        // iWork spreadsheet formats
     2295        $sheet_mime_types  = 'application/vnd.apple.numbers';
     2296        // MS Office spreadsheet formats
     2297        $sheet_mime_types .= ',application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel.sheet.macroEnabled.12,application/vnd.ms-excel.sheet.binary.macroEnabled.12,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.ms-excel.template.macroEnabled.12,application/vnd.ms-excel.addin.macroEnabled.12';
     2298        // OpenOffice spreadsheet formats
     2299        $sheet_mime_types .= ',application/vnd.oasis.opendocument.spreadsheet';
     2300        // Text spreadsheet formats
     2301        $sheet_mime_types .= ',text/csv,text/tab-separated-values';
     2302       
     2303        // MS Office presentation formats
     2304        $interactive_mime_types  = 'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-powerpoint.presentation.macroEnabled.12,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/vnd.ms-powerpoint.slideshow.macroEnabled.12,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.ms-powerpoint.template.macroEnabled.12,application/vnd.ms-powerpoint.addin.macroEnabled.12,application/vnd.openxmlformats-officedocument.presentationml.slide,application/vnd.ms-powerpoint.slide.macroEnabled.12';
     2305        // OpenOffice presentation spreadsheet formats
     2306        $interactive_mime_types .= ',application/vnd.oasis.opendocument.presentation';
     2307        // iWork presentation formats
     2308        $interactive_mime_types .= ',application/vnd.apple.keynote';
     2309
     2310        $webdoc_mime_types = 'text/css,text/html,application/javascript,application/x-shockwave-flash,application/java'; // ok
     2311
     2312        $archive_mime_types = 'application/x-tar,application/zip,application/x-gzip,application/rar,application/x-7z-compressed'; // ok
     2313
     2314        $misc_mime_types = 'application/x-msdownload';
     2315
    22782316        $post_mime_types = array(       //      array( adj, noun )
    22792317                'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
    22802318                'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
    22812319                'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
     2320                $doc_mime_types => array(__('Documents'), __('Manage Documents'), _n_noop('Document <span class="count">(%s)</span>', 'Documents <span class="count">(%s)</span>')),
     2321                $sheet_mime_types => array(__('Spreadsheets'), __('Manage Spreadsheets'), _n_noop('Spreadsheet <span class="count">(%s)</span>', 'Spreadsheets <span class="count">(%s)</span>')),
     2322                $interactive_mime_types => array(__('Interactives'), __('Manage Interactives'), _n_noop('Interactive <span class="count">(%s)</span>', 'Interactives <span class="count">(%s)</span>')),
     2323                $webdoc_mime_types => array(__('Web Documents'), __('Manage Web Documents'), _n_noop('Web Document <span class="count">(%s)</span>', 'Web Documents <span class="count">(%s)</span>')),
     2324                $archive_mime_types => array(__('Archives'), __('Manage Archives'), _n_noop('Archive <span class="count">(%s)</span>', 'Archives <span class="count">(%s)</span>')),
    22822325        );
    22832326
    22842327        /**