wp plugin refacotr
This commit is contained in:
@@ -105,6 +105,13 @@ class Igny8Admin {
|
||||
'sanitize_callback' => array($this, 'sanitize_modules'),
|
||||
'default' => array_keys(igny8_get_available_modules())
|
||||
));
|
||||
|
||||
// Default post status for IGNY8 published content
|
||||
register_setting('igny8_bridge_controls', 'igny8_default_post_status', array(
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => array($this, 'sanitize_post_status'),
|
||||
'default' => 'draft'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -617,6 +624,17 @@ class Igny8Admin {
|
||||
|
||||
return !empty($clean) ? $clean : $supported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize post status
|
||||
*
|
||||
* @param string $value Post status value
|
||||
* @return string Sanitized post status
|
||||
*/
|
||||
public function sanitize_post_status($value) {
|
||||
$allowed = array('draft', 'publish');
|
||||
return in_array($value, $allowed, true) ? $value : 'draft';
|
||||
}
|
||||
}
|
||||
|
||||
// Register AJAX handlers
|
||||
|
||||
Reference in New Issue
Block a user