WordPress.org

Make WordPress Core

Ticket #38195: 38195.2.diff

File 38195.2.diff, 5.2 KB (added by swissspidy, 18 months ago)
  • src/wp-includes/post.php

    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index 52fb11909c..36c9f49e9f 100644
    function wp_count_attachments( $mime_type = '' ) { 
    24372437 * @return array List of post mime types.
    24382438 */
    24392439function get_post_mime_types() {
     2440        // Misc application doc formats.
     2441        $doc_mime_types = 'application/pdf,application/rtf';
     2442        // Text doc formats.
     2443        $doc_mime_types .= ',text/plain,text/richtext';
     2444        // WordPerfect doc formats.
     2445        $doc_mime_types .= ',application/wordperfect';
     2446        // OpenOffice doc formats.
     2447        $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';
     2448        // iWork doc formats.
     2449        $doc_mime_types .= ',application/vnd.apple.pages';
     2450        // MS Office doc formats.
     2451        $doc_mime_types .= 'application/msword,application/vnd.ms-write,application/onenote';
     2452        $doc_mime_types .= ',application/vnd.ms-access';
     2453        $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';
     2454
     2455        // iWork spreadsheet formats.
     2456        $sheet_mime_types = 'application/vnd.apple.numbers';
     2457        // MS Office spreadsheet formats.
     2458        $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';
     2459        // OpenOffice spreadsheet formats.
     2460        $sheet_mime_types .= ',application/vnd.oasis.opendocument.spreadsheet';
     2461        // Text spreadsheet formats.
     2462        $sheet_mime_types .= ',text/csv,text/tab-separated-values';
     2463
     2464        // MS Office presentation formats.
     2465        $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';
     2466        // OpenOffice presentation spreadsheet formats.
     2467        $interactive_mime_types .= ',application/vnd.oasis.opendocument.presentation';
     2468        // iWork presentation formats.
     2469        $interactive_mime_types .= ',application/vnd.apple.keynote';
     2470
     2471        $webdoc_mime_types = 'text/css,text/html,application/javascript,application/x-shockwave-flash,application/java';
     2472
     2473        $archive_mime_types = 'application/x-tar,application/zip,application/x-gzip,application/rar,application/x-7z-compressed';
     2474
     2475        $misc_mime_types = 'application/x-msdownload';
     2476
    24402477        $post_mime_types = array(   //  array( adj, noun )
    2441                 'image' => array( __( 'Images' ), __( 'Manage Images' ), _n_noop( 'Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>' ) ),
    2442                 'audio' => array( __( 'Audio' ), __( 'Manage Audio' ), _n_noop( 'Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>' ) ),
    2443                 'video' => array( __( 'Video' ), __( 'Manage Video' ), _n_noop( 'Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>' ) ),
     2478                'image'                 => array(
     2479                        __( 'Images' ),
     2480                        __( 'Manage Images' ),
     2481                        _n_noop( 'Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>' )
     2482                ),
     2483                'audio'                 => array(
     2484                        __( 'Audio' ),
     2485                        __( 'Manage Audio' ),
     2486                        _n_noop( 'Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>' )
     2487                ),
     2488                'video'                 => array(
     2489                        __( 'Video' ),
     2490                        __( 'Manage Video' ),
     2491                        _n_noop( 'Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>' )
     2492                ),
     2493                $doc_mime_types         => array(
     2494                        __( 'Documents' ),
     2495                        __( 'Manage Documents' ),
     2496                        _n_noop( 'Document <span class="count">(%s)</span>', 'Documents <span class="count">(%s)</span>' )
     2497                ),
     2498                $sheet_mime_types       => array(
     2499                        __( 'Spreadsheets' ),
     2500                        __( 'Manage Spreadsheets' ),
     2501                        _n_noop( 'Spreadsheet <span class="count">(%s)</span>', 'Spreadsheets <span class="count">(%s)</span>' )
     2502                ),
     2503                $interactive_mime_types => array(
     2504                        __( 'Interactives' ),
     2505                        __( 'Manage Interactives' ),
     2506                        _n_noop( 'Interactive <span class="count">(%s)</span>', 'Interactives <span class="count">(%s)</span>' )
     2507                ),
     2508                $webdoc_mime_types      => array(
     2509                        __( 'Web Documents' ),
     2510                        __( 'Manage Web Documents' ),
     2511                        _n_noop( 'Web Document <span class="count">(%s)</span>', 'Web Documents <span class="count">(%s)</span>' )
     2512                ),
     2513                $archive_mime_types     => array(
     2514                        __( 'Archives' ),
     2515                        __( 'Manage Archives' ),
     2516                        _n_noop( 'Archive <span class="count">(%s)</span>', 'Archives <span class="count">(%s)</span>' )
     2517                ),
    24442518        );
    24452519
    24462520        /**