PHP code example of soderlind / super-admin-all-sites-menu

1. Go to this page and download the library: Download soderlind/super-admin-all-sites-menu 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/ */

    

soderlind / super-admin-all-sites-menu example snippets


    add_filter( 'all_sites_menu_order_by', function( string $order_by ) : string {
    	return 'url';
    } );
    

  add_filter( 'all_sites_menu_load_increments', function( int $increments ) : int {
  	return 300;
  } );
  

   add_filter( 'all_sites_menu_plugin_trigger', function( array $plugins ) : array {
  	return [
  		'restricted-site-access/restricted_site_access.php',
  		'myplugin/myplugin.php',
  	];
  } );
  

  add_filter( 'all_sites_menu_search_threshold', function( int $increments ) : int {
  	return 40;
  } );
  

    add_filter( 'all_sites_menu_force_refresh_expiration', function( int $seconds ) : int {
    	return 3600;
    } );
    

   wp_add_inline_script( 'super-admin-all-sites-menu', "const pluginAllSitesMenu = {$data};", 'before' );
   

   $data = wp_json_encode([
   	'timestamp' => $this->get_timestamp(),
   // other data...
   ]);