working on documentation
This commit is contained in:
parent
1eb372c158
commit
35940174ff
@ -29,6 +29,9 @@ class WhatDidTheySayAdmin {
|
|||||||
$this->language_file = dirname(__FILE__) . '/../data/lsr-language.txt';
|
$this->language_file = dirname(__FILE__) . '/../data/lsr-language.txt';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the object.
|
||||||
|
*/
|
||||||
function init() {
|
function init() {
|
||||||
$this->capabilities = array(
|
$this->capabilities = array(
|
||||||
'submit_transcriptions' => __('Submit transcriptions to a post', 'what-did-they-say'),
|
'submit_transcriptions' => __('Submit transcriptions to a post', 'what-did-they-say'),
|
||||||
@ -54,6 +57,9 @@ class WhatDidTheySayAdmin {
|
|||||||
$this->read_language_file();
|
$this->read_language_file();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* user_has_cap filter.
|
||||||
|
*/
|
||||||
function user_has_cap($capabilities, $requested_capabilities, $capability_name) {
|
function user_has_cap($capabilities, $requested_capabilities, $capability_name) {
|
||||||
$options = get_option('what-did-they-say-options');
|
$options = get_option('what-did-they-say-options');
|
||||||
|
|
||||||
@ -75,12 +81,9 @@ class WhatDidTheySayAdmin {
|
|||||||
return $capabilities;
|
return $capabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _update_options($which, $value) {
|
/**
|
||||||
$options = get_option('what-did-they-say-options');
|
* Show admin notices.
|
||||||
$options[$which] = $value;
|
*/
|
||||||
update_option('what-did-they-say-options', $options);
|
|
||||||
}
|
|
||||||
|
|
||||||
function admin_notices() {
|
function admin_notices() {
|
||||||
if (!empty($this->notices)) {
|
if (!empty($this->notices)) {
|
||||||
echo '<div class="updated fade">';
|
echo '<div class="updated fade">';
|
||||||
@ -89,6 +92,9 @@ class WhatDidTheySayAdmin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle an update to options.
|
||||||
|
*/
|
||||||
function handle_update($info) {
|
function handle_update($info) {
|
||||||
foreach (get_class_methods($this) as $method) {
|
foreach (get_class_methods($this) as $method) {
|
||||||
if (strpos($method, "handle_update_") === 0) {
|
if (strpos($method, "handle_update_") === 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user