wp plugin refacotr

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-01 06:57:54 +00:00
parent 7357846527
commit 50af3501ac
8 changed files with 602 additions and 55 deletions

View File

@@ -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