PHP code example of deliciousmedia / quickrest

1. Go to this page and download the library: Download deliciousmedia/quickrest library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

deliciousmedia / quickrest example snippets


function my_plugin_map_function( $map ) {
  $new_map = [
    'someplugin' => [ 'some-plugin/some-plugin.php' ],
    'wp'         => [ 'plugin-one/plugin-one.php', 'plugin-two/plugin-two.php' ]
   ];
  return array_merge_recursive( $map, $new_map );
}
add_filter( 'quickrest_plugin_map', 'my_plugin_map_function', 15, 1 );

add_filter(
  'quickrest_plugin_map',
  function( $map ) {
    // Remove our filter so we don't get stuck in a loop when getting the active_plugins option.
    remove_filter( 'option_active_plugins', 'quickrest_filter_plugins', PHP_INT_MAX - 1 );
    $new_map = [
      '_default' => get_option( 'active_plugins' ),
    ];
    add_filter( 'option_active_plugins', 'quickrest_filter_plugins', PHP_INT_MAX - 1 );
    return array_merge_recursive( $map, $new_map );
  },
  10,
  1
);