Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #57249, comment 2


Ignore:
Timestamp:
12/05/2022 10:58:34 AM (3 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57249, comment 2

    initial v1  
    1313get_plugins('/classic-editor'); does return the plugin details as expected (with the folder pruned from the array) so the returned array is different when a folder is added to the request, meaning any changes to the function would be difficult to implement.
    1414
     15> {{{
    1516> wp_cache_flush();
    16 get_plugins(); //miss cache
    17 get_plugins('/classic-editor'); //miss cache
    18 get_plugins(); //hit cache
    19 get_plugins(); //hit cache
    20 get_plugins('/classic-editor'); //hit cache
     17> get_plugins(); //miss cache
     18> get_plugins('/classic-editor'); //miss cache
     19> get_plugins(); //hit cache
     20> get_plugins(); //hit cache
     21> get_plugins('/classic-editor'); //hit cache
     22> }}}
    2123
    2224I can also replicate this. I had assumed it would clear the cached array but it just appends the new array each time so future duplicate requests return a cache hit.