1
Common WordPress APIs:
Global Variables
Jonathan Bossenger
Learn.WordPress.org
2
👋🏽 Welcome!
As you join, let everyone know in the chat where you’re
joining us from…
Hello!
○ My name is Jonathan Bossenger
○ From Cape Town, South Africa
○ Developer educator at Automattic
○ Sponsored to work with the Training Team
○ jonathanbossenger.com
Learn.WordPress.org
Global Variables
Jonathan Bossenger
Announcements
○ Welcome.
○ Please let me know if you can’t see this slide!
○ We are presenting in focus mode, but please feel free to enable your video.
○ You are welcome to ask questions.
○ You are welcome to post questions in the chat, or unmute to ask questions.
Announcements
○ Make sure your local install is ready
○ If I am going too fast, please let me know!
○ We will be posting this session to https://wordpress.tv/ afterwards.
○ For WordPress tutorials and courses please visit https://learn.wordpress.org/
○ For WordPress developer news and updates please visit
https://developer.wordpress.org/news/
Learning outcomes
○ What are global variables in PHP?
○ How to define global variables to use them?
○ Why global variables are considered bad?
○ What global variables are available in WordPress?
○ How to interact with WordPress global variables?
Question time
○ On a scale of 1 to 5, how well do you know this topic?
Requirements
○ A default local WordPress install
○ A text editor
○ At least one active theme and plugin
• I’ll be using Twenty Twenty-Three and Create Block Theme
Let’s go!
Resources
○ https://www.php.net/manual/en/language.variables.scope.php
○ https://developer.wordpress.org/apis/global-variables/

Common WordPress APIs_ Global Variables