Making WordPress.org

Changeset 7509


Ignore:
Timestamp:
07/27/2018 05:01:15 AM (8 years ago)
Author:
tellyworth
Message:

Gutenberg: suppress autosave API calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/functions.php

    r7507 r7509  
    3232                wp_enqueue_style( 'l10n' );
    3333                wp_enqueue_style( 'buttons' );
     34                wp_add_inline_script( 'wp-api-fetch',
     35                        sprintf(
     36                                'wp.apiFetch.use( function( options, next ) {
     37                                        if ( options.path = "/wp/v2/posts/%d/autosaves" ) {
     38                                                return Promise.resolve( [ { "id": %d } ] ); //not sure what this actually should be, etc.
     39                                        }
     40
     41                                        return next( options );
     42                                } );',
     43                                113,
     44                                113
     45                        ),
     46                        'after'
     47                );
    3448        } );
    3549        add_action( 'wp_enqueue_scripts', 'gutenberg_editor_scripts_and_styles' );
Note: See TracChangeset for help on using the changeset viewer.