' . esc_html__( 'Settings', 'stubli' ) . '' );
return $links;
}
/**
* Render the screen.
*/
public static function render() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$s = Settings::get();
$saved = isset( $_GET['saved'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$row = static function ( $name, $label, $help, $checked ) {
printf(
'
| %2$s | |
',
esc_attr( $name ),
esc_html( $label ),
esc_html( $help ),
checked( $checked, true, false )
);
};
?>
·
' . esc_html__( 'open Webmention in Plugins', 'stubli' ) . '' ); ?>
403 ) );
}
check_admin_referer( 'stubli_save_settings' );
// phpcs:disable WordPress.Security.NonceVerification.Missing -- checked above.
$changes = array(
'search_engines' => ! empty( $_POST['search_engines'] ),
'credit' => ! empty( $_POST['credit'] ),
'block_ai' => ! empty( $_POST['block_ai'] ),
'on_break' => ! empty( $_POST['on_break'] ),
'who_can_comment' => isset( $_POST['who_can_comment'] ) ? sanitize_key( wp_unslash( $_POST['who_can_comment'] ) ) : 'friends_of_friends',
'pronouns' => isset( $_POST['pronouns'] ) ? sanitize_text_field( wp_unslash( $_POST['pronouns'] ) ) : '',
);
if ( 'stubli' !== get_option( 'stylesheet' ) ) {
$changes['look'] = ! empty( $_POST['look'] );
}
Settings::update( $changes );
update_option( 'stubli_bio', isset( $_POST['bio'] ) ? mb_substr( sanitize_textarea_field( wp_unslash( $_POST['bio'] ) ), 0, 160 ) : '' );
// phpcs:enable
wp_safe_redirect( admin_url( 'options-general.php?page=' . self::PAGE . '&saved=1' ) );
exit;
}
}