<?php
/*
Plugin Name: Add Apply Button
Description: Adds an "Apply" button beside "Save" buttons
Author: Chris
Version: 0.04
Requires at least: 3.00
*/

addFilter('adminUI_args', '_add_apply_button', null, 3);

function _add_apply_button($adminUI_args, $tableName, $action) {
  if (in_array($action, ['edit', 'add'])) { // display only when adding or editing a record
    @array_unshift($adminUI_args['BUTTONS'], [ // add button on left
      'label'   => t('Apply'),
      'name'    => '_action=save',
      'onclick' => "edit_postSave = function(num) { window.location = \"?menu=$tableName&action=edit&num=\" + num; edit_postSave = null; return true; };",
    ]);
  }
  return $adminUI_args;
}



// EOF