Docs: Upgrading from 1.16

Upgrading from 1.16

Five habits from 1.16 themes worth replacing, and the call to use instead of each.

Nothing breaks: every call that was there is unchanged. Five habits are worth replacing.

  • A query of the settings table for the name or the social links: use $this->site().
  • !empty($_SESSION['UserID']): use $this->visitor()['signed_in'], with account_url and login_url.
  • Formatting a date with a time zone of your own: use $this->date($value, 'short').
  • Reading $_GET['page'] or $_SERVER['REQUEST_URI']: use $this->query('page', 'int', 1) and $this->currentUrl(['page' => $n]).
  • html_entity_decode() on an item's image before an <img>: use $this->picture($item).

The longer guide to writing a theme is Themes.