xxxxxxxxxx
// Check if the widget option is visible and available in WordPress
// Get the widget object
$widget = wp_get_widget('widget_id');
if ($widget && isset($widget['callback'][0])) {
// Get the widget callback function
$callback = $widget['callback'][0];
// Get the widget control settings
$settings = $callback->get_settings();
// Check if the specific widget option is available
if (isset($settings['_widget_option'])) {
// Display the widget option
echo 'Widget option is available: ' . $settings['_widget_option'];
} else {
// Widget option is not available
echo 'Widget option is not available';
}
} else {
// Widget not found or invalid widget ID
echo 'Invalid widget ID';
}