這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

occupied

外掛說明

custom page locking for WordPress admin screens

usage

In the function for your custom page, just use Occupied::protect() to enable locking on that page.

<?php 
add_action('admin_menu', 'register_my_plugin_menu');

function register_my_plugin_menu(){
  add_menu_page("My Cool Plugin", "cool-plugin", "manage_options", "my_cool_plugin_page", "render_my_cool_plugin", "dashicons-heart", 7);
}

function render_my_cool_plugin(){
  // Occupied::protect enables locking on this page
  // and returns a lock array
  // optional: pass a message to the protect method to appear on the lock modal.
  $lock = Occupied::protect("Cool Plugin Occupied!");

  echo "<h1>My Cool Plugin!</h1>";
}
?>

In another action, you can check whether a screen is occupied by the current user

<?php
function some_other_action(){
  if(Occupied::is_authorized('toplevel_page_my_cool_plugin_page')){
    // business logic, save to database, etc..
  }else{
    // return error
  }
}
?><h3>todo</h3>

* break out styles
* add locking hooks
* rethink using vue for a modal and some event handlers

developers

This plugin is developed on github

license

GPLv3

螢幕擷圖

  • Demonstration

安裝方式

put this plugin in the plugins directory of your wordpress installation

or

include the plugin in the root folder of your own plugin and require it with

require_once('occupied-installation-folder/occupied.php');

常見問題集

Installation Instructions

put this plugin in the plugins directory of your wordpress installation

or

include the plugin in the root folder of your own plugin and require it with

require_once('occupied-installation-folder/occupied.php');

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈occupied〉的開發相關工作。

參與者

將〈occupied〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

  • Initial upload