post_type !== 'blyzer_event') return;
$key = 'blyzer_key_invalid_' . get_current_user_id();
if (!get_transient($key)) return;
delete_transient($key);
echo '
'
. esc_html__('The API key was not saved: it may contain only letters and digits (max. 128 characters).', 'blyzer-events')
. '
';
}
public static function renderApi($post): void
{
$postId = (int) $post->ID;
$key = (string) get_post_meta($postId, '_blyzer_api_key', true);
$saved = $post->post_status !== 'auto-draft';
$info = trim($key) !== '' && $saved ? Connection::describe(Api::pingCached($postId), []) : Connection::describe(null);
if ($info['status'] === 'ok') $info = Connection::describe(200, Api::fetch($postId, 'event'));
wp_nonce_field('blyzer_event_save', 'blyzer_event_nonce');
?>
-
>
post_status !== 'publish'): ?>
$label): ?>
$label):
$use = (int) get_post_meta($postId, '_blyzer_tpl_custom_' . $type, true);
$tpl = (string) get_post_meta($postId, '_blyzer_tpl_' . $type, true);
$boxId = 'blyzer_tpl_box_' . $type;
?>
= 300 || trim((string) $post->post_title) !== '') return;
$title = sanitize_text_field(Data::str(Api::fetch($postId, 'event')['title'] ?? ''));
if ($title === '') return;
remove_action('save_post_blyzer_event', [self::class, 'save'], 20);
wp_update_post(['ID' => $postId, 'post_title' => mb_substr($title, 0, 200)]);
add_action('save_post_blyzer_event', [self::class, 'save'], 20, 2);
}
}