-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create remaining issues out of this overview #24530
Comments
How would that work @noisysocks? HTML widget is good for storing HTML, but we also want to be able to edit these blocks as, well, blocks. Also I think it would break interoperability with the old widgets screen since the custom HTML widget would only render raw contents only, e.g. |
Yep, good points. I think |
I am unable to reproduce that @noisysocks, would you mind providing step-by-step instructions or a gif? |
function marquee_greeting_init() {
wp_register_sidebar_widget(
'marquee_greeting',
'Marquee Greeting',
function() {
$greeting = get_option( 'marquee_greeting', 'Hello!' );
printf( '<marquee>%s</marquee>', esc_html( $greeting ) );
}
);
wp_register_widget_control(
'marquee_greeting',
'Marquee Greeting',
function() {
if ( isset( $_POST['marquee-greeting'] ) ) {
update_option(
'marquee_greeting',
sanitize_text_field( $_POST['marquee-greeting'] )
);
}
$greeting = get_option( 'marquee_greeting' );
?>
<p>
<label for="marquee-greeting">Greeting:</label>
<input
id="marquee-greeting"
class="widefat"
name="marquee-greeting"
type="text"
value="<?= esc_attr( $greeting ) ?>"
placeholder="Hello!"
/>
</p>
<?php
}
);
}
add_action( 'init', 'marquee_greeting_init' );
|
Thank you @noisysocks, I think I got confused with all the wording (beta widgets screen, legacy widgets screen, legacy widgets, legacy not-so-legacy widgets, block widgets), definitely a case something we could solve with a ubiquitous language. Maybe.. function-based legacy widgets, class-based legacy widgets, block-based widgets? |
@adamziel @draganescu maybe create separate issues and let's close this giant one. |
This issue tracks necessary follow-up work from merging #24290.
Has PR:
[edit-widgets] Simplify gutenberg_widgets_init when $hook === 'widgets.php' #24793
Lower priority:
packages/edit-widgets/store
. First stab at sidebars_widgets-based widget management #24290 (review)Discussion in progress:
'text' => '<script>alert(1)</script>'
(Sidebars API - XSS or not XSS? #24863)Don't do now:
The text was updated successfully, but these errors were encountered: