示例#1
0
<?php

$plugin_groups = Plugin_Groups_Options::get_single('plugin_groups');
$plugins = get_plugins();
?>
<div class="wrap" id="plugin-groups-main-canvas">
	<span class="wp-baldrick spinner" style="float: none; display: block;" data-target="#plugin-groups-main-canvas" data-callback="plorg_canvas_init" data-type="json" data-request="#plugin-groups-live-config" data-event="click" data-template="#main-ui-template" data-autoload="true"></span>
</div>

<div class="clear"></div>

<input type="hidden" class="clear" autocomplete="off" id="plugin-groups-live-config" style="width:100%;" value="<?php 
echo esc_attr(json_encode($plugin_groups));
?>
">

<script type="text/html" id="main-ui-template">
	<?php 
// pull in the join table card template
include PLORG_PATH . 'includes/templates/main-ui.php';
?>
	
</script>





 /**
  * alter and set the current status.
  *
  * @since 0.0.1
  * @return array|plugins - no change
  */
 public function prepare_filter_addons($plugins)
 {
     global $wp_list_table, $status;
     // work on plugins list
     $plugin_groups = Plugin_Groups_Options::get_single('plugin_groups');
     if (isset($_REQUEST['plugin_status']) && !empty($plugin_groups['group'])) {
         foreach ($plugin_groups['group'] as $group) {
             $key = sanitize_key($group['config']['group_name']);
             if ($_REQUEST['plugin_status'] === $key) {
                 $status = $key;
                 break;
             }
         }
     }
     return $plugins;
 }