Check if $post defined before trying to use its field values.
authorTom Anderson <twocs@users.noreply.github.com>
Sun, 16 Aug 2020 02:37:36 +0000 (12:07 +0930)
committerGitHub <noreply@github.com>
Sun, 16 Aug 2020 02:37:36 +0000 (12:07 +0930)
commit337df6ce3ad091bfd6da1556fabd4b87fe0a1c6d
tree9966dd6b0a5ae11a78470e10c62f58f59b26b520
parentb2b1b9a410d7667cfdf89bc8335b552025ea1f84
Check if $post defined before trying to use its field values.

Admin pages (e.g. in a custom plugin) may see $post as undefined. The existing usage to get permalinks for these pages can fill debug logs with PHP Notices.
CRM/Utils/System/WordPress.php