WordPress.org

Make WordPress Core

Changeset 40060


Ignore:
Timestamp:
02/15/17 17:28:54 (2 months ago)
Author:
adamsilverstein
Message:

Media: debounce the media grid search, avoiding duplicate requests.

Add a debounce wrapper to the media grid search handler. The search callback is now fired after a 300 ms typing pause.

Remove redundant handlers for 'search' and 'change', preventing multiple/duplicate search callbacks.

Props certainstrings, joemcgill, Kelderic, batmoo.
Fixes #38911.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r40051 r40060  
    70867086    events: { 
    70877087        'input':  'search', 
    7088         'keyup':  'search', 
    7089         'change': 'search', 
    7090         'search': 'search' 
     7088        'keyup':  'search' 
    70917089    }, 
    70927090 
     
    70997097    }, 
    71007098 
    7101     search: function( event ) { 
     7099    search: _.debounce( function( event ) { 
    71027100        if ( event.target.value ) { 
    71037101            this.model.set( 'search', event.target.value ); 
     
    71057103            this.model.unset('search'); 
    71067104        } 
    7107     } 
     7105    }, 300 ) 
    71087106}); 
    71097107 
  • trunk/src/wp-includes/js/media/views/search.js

    r38795 r40060  
    2222    events: { 
    2323        'input':  'search', 
    24         'keyup':  'search', 
    25         'change': 'search', 
    26         'search': 'search' 
     24        'keyup':  'search' 
    2725    }, 
    2826 
     
    3533    }, 
    3634 
    37     search: function( event ) { 
     35    search: _.debounce( function( event ) { 
    3836        if ( event.target.value ) { 
    3937            this.model.set( 'search', event.target.value ); 
     
    4139            this.model.unset('search'); 
    4240        } 
    43     } 
     41    }, 300 ) 
    4442}); 
    4543 
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r40058 r40060  
    1313mockedApiResponse.oembeds = {"code":"rest_missing_callback_param","message":"Missing parameter(s): url","data":{"status":400,"params":["url"]}}; 
    1414 
    15 mockedApiResponse.PostsCollection = [{"id":1368,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?p=1368"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6208","type":"post","link":"http:\/\/example.org\/?p=1368","title":{"rendered":"Post title 6208"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6208<\/p>\n","protected":false},"author":354,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=1368"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368\/revisions"}],"wp:attachment":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcategories&post=1368"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Ftags&post=1368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]; 
     15mockedApiResponse.PostsCollection = [{"id":3,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?p=3"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-19","type":"post","link":"http:\/\/example.org\/?p=3","title":{"rendered":"Post title 19"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 19<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=3"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3\/revisions"}],"wp:attachment":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcategories&post=3"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Ftags&post=3"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]; 
    1616 
    17 mockedApiResponse.PostModel = {"id":1368,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?p=1368"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6208","type":"post","link":"http:\/\/example.org\/?p=1368","title":{"rendered":"Post title 6208"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6208<\/p>\n","protected":false},"author":354,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"categories":[1],"tags":[]}; 
     17mockedApiResponse.PostModel = {"id":3,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?p=3"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-19","type":"post","link":"http:\/\/example.org\/?p=3","title":{"rendered":"Post title 19"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 19<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[]}; 
    1818 
    19 mockedApiResponse.postRevisions = [{"author":"354","date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","id":1371,"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","parent":1368,"slug":"1368-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=1371"},"title":{"rendered":"Post title 6208"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 6208<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368"}]}}]; 
     19mockedApiResponse.postRevisions = [{"author":"2","date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","id":6,"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","parent":3,"slug":"3-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=6"},"title":{"rendered":"Post title 19"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 19<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3"}]}}]; 
    2020 
    2121mockedApiResponse.revision = {"code":"rest_post_invalid_id","message":"Invalid revision ID.","data":{"status":404}}; 
    2222 
    23 mockedApiResponse.PagesCollection = [{"id":1369,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?page_id=1369"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6209","type":"page","link":"http:\/\/example.org\/?page_id=1369","title":{"rendered":"Post title 6209"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6209<\/p>\n","protected":false},"author":354,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/1369"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=1369"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/1369\/revisions"}],"wp:attachment":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]; 
     23mockedApiResponse.PagesCollection = [{"id":4,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?page_id=4"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-20","type":"page","link":"http:\/\/example.org\/?page_id=4","title":{"rendered":"Post title 20"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 20<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/4"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=4"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/4\/revisions"}],"wp:attachment":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]; 
    2424 
    25 mockedApiResponse.PageModel = {"id":1369,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?page_id=1369"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6209","type":"page","link":"http:\/\/example.org\/?page_id=1369","title":{"rendered":"Post title 6209"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6209<\/p>\n","protected":false},"author":354,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]}}; 
     25mockedApiResponse.PageModel = {"id":4,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?page_id=4"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-20","type":"page","link":"http:\/\/example.org\/?page_id=4","title":{"rendered":"Post title 20"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 20<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[]}; 
    2626 
    27 mockedApiResponse.pageRevisions = [{"author":"354","date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","id":1372,"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","parent":1369,"slug":"1369-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=1372"},"title":{"rendered":"Post title 6209"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 6209<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/1369"}]}}]; 
     27mockedApiResponse.pageRevisions = [{"author":"2","date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","id":7,"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","parent":4,"slug":"4-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=7"},"title":{"rendered":"Post title 20"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 20<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/4"}]}}]; 
    2828 
    2929mockedApiResponse.pageRevision = {"code":"rest_post_invalid_id","message":"Invalid revision ID.","data":{"status":404}}; 
    3030 
    31 mockedApiResponse.MediaCollection = [{"id":1370,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?attachment_id=1370"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"1370","type":"attachment","link":"http:\/\/example.org\/?attachment_id=1370","title":{"rendered":""},"author":354,"comment_status":"open","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg","_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media\/1370"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/attachment"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=1370"}]}}]; 
     31mockedApiResponse.MediaCollection = [{"id":5,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?attachment_id=5"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"5","type":"attachment","link":"http:\/\/example.org\/?attachment_id=5","title":{"rendered":""},"author":2,"comment_status":"open","ping_status":"closed","template":"","meta":[],"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg","_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media\/5"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/attachment"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=5"}]}}]; 
    3232 
    33 mockedApiResponse.MediaModel = {"id":1370,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?attachment_id=1370"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"1370","type":"attachment","link":"http:\/\/example.org\/?attachment_id=1370","title":{"rendered":""},"author":354,"comment_status":"open","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg"}; 
     33mockedApiResponse.MediaModel = {"id":5,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?attachment_id=5"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"5","type":"attachment","link":"http:\/\/example.org\/?attachment_id=5","title":{"rendered":""},"author":2,"comment_status":"open","ping_status":"closed","template":"","meta":[],"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg"}; 
    3434 
    3535mockedApiResponse.TypesCollection = {"post":{"description":"","hierarchical":false,"name":"Posts","slug":"post","taxonomies":["category","post_tag"],"rest_base":"posts","_links":{"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types"}],"wp:items":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},"page":{"description":"","hierarchical":true,"name":"Pages","slug":"page","taxonomies":[],"rest_base":"pages","_links":{"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types"}],"wp:items":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},"attachment":{"description":"","hierarchical":false,"name":"Media","slug":"attachment","taxonomies":[],"rest_base":"media","_links":{"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types"}],"wp:items":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}}; 
     
    4949mockedApiResponse.CategoryModel = {"id":1,"count":1,"description":"","link":"http:\/\/example.org\/?cat=1","name":"Uncategorized","slug":"uncategorized","taxonomy":"category","parent":0,"meta":[]}; 
    5050 
    51 mockedApiResponse.TagsCollection = [{"id":685,"count":0,"description":"Term description 6210","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags\/685"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies\/post_tag"}],"wp:post_type":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&tags=685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]; 
     51mockedApiResponse.TagsCollection = [{"id":2,"count":0,"description":"Term description 21","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags\/2"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies\/post_tag"}],"wp:post_type":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&tags=2"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]; 
    5252 
    53 mockedApiResponse.TagModel = {"id":685,"count":0,"description":"Term description 6210","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[]}; 
     53mockedApiResponse.TagModel = {"id":2,"count":0,"description":"Term description 21","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[]}; 
    5454 
    55 mockedApiResponse.UsersCollection = [{"id":1,"name":"admin","url":"","description":"","link":"http:\/\/example.org\/?author=1","slug":"admin","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}},{"id":354,"name":"User 6207","url":"","description":"","link":"http:\/\/example.org\/?author=354","slug":"user-6207","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/354"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}}]; 
     55mockedApiResponse.UsersCollection = [{"id":1,"name":"admin","url":"","description":"","link":"http:\/\/example.org\/?author=1","slug":"admin","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}},{"id":2,"name":"User 18","url":"","description":"","link":"http:\/\/example.org\/?author=2","slug":"user-18","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}}]; 
    5656 
    5757mockedApiResponse.UserModel = {"id":1,"name":"admin","url":"","description":"","link":"http:\/\/example.org\/?author=1","slug":"admin","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g"},"meta":[]}; 
    5858 
    59 mockedApiResponse.me = {"id":354,"name":"User 6207","url":"","description":"","link":"http:\/\/example.org\/?author=354","slug":"user-6207","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=96&d=mm&r=g"},"meta":[]}; 
     59mockedApiResponse.me = {"id":2,"name":"User 18","url":"","description":"","link":"http:\/\/example.org\/?author=2","slug":"user-18","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=96&d=mm&r=g"},"meta":[]}; 
    6060 
    61 mockedApiResponse.CommentsCollection = [{"id":1103,"post":1368,"parent":0,"author":0,"author_name":"Commenter 6211","author_url":"http:\/\/example.com\/6211\/","date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","content":{"rendered":"<p>This is a comment<\/p>\n"},"link":"http:\/\/example.org\/?p=1368#comment-1103","status":"approved","type":"comment","author_avatar_urls":{"24":"http:\/\/1.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/1.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments\/1103"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368"}]}}]; 
     61mockedApiResponse.CommentsCollection = [{"id":2,"post":3,"parent":0,"author":0,"author_name":"Commenter 22","author_url":"http:\/\/example.com\/22\/","date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","content":{"rendered":"<p>This is a comment<\/p>\n"},"link":"http:\/\/example.org\/?p=3#comment-2","status":"approved","type":"comment","author_avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/1.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments\/2"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3"}]}}]; 
    6262 
    6363mockedApiResponse.CommentModel = {"code":"rest_comment_invalid_id","message":"Invalid comment ID.","data":{"status":404}}; 
Note: See TracChangeset for help on using the changeset viewer.