Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
drupal_set_title() is completely incompatible with any kind of render caching.
Similar to drupal_add_link(), drupal_add_css() and drupal_add_js() we should make it work with #attached.
Even if we eventually move #attached to the response object in some way, it'll need to work more or less the same way there too.
Comments
Comment #1
tim.plunkettMajor +1. Especially since it would remove the need for stupid page callbacks like
Comment #2
catchDuplicate of #1830588: [META] remove drupal_set_title() and drupal_get_title()