SlideShare a Scribd company logo
1 of 10
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/

More Related Content

Similar to Common WordPress APIs_ Global Variables

Custom Tables in WordPress
Custom Tables in WordPressCustom Tables in WordPress
Custom Tables in WordPressJonathan Bossenger
 
The WordPress Create Block tool
The WordPress Create Block toolThe WordPress Create Block tool
The WordPress Create Block toolJonathan Bossenger
 
Testing WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer editionTesting WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer editionJonathan Bossenger
 
What’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptxWhat’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptxJonathan Bossenger
 
Help test WordPress - developer edition
Help test WordPress - developer editionHelp test WordPress - developer edition
Help test WordPress - developer editionJonathan Bossenger
 
Testing plugins for PHP 8
Testing plugins for PHP 8Testing plugins for PHP 8
Testing plugins for PHP 8Jonathan Bossenger
 
Let's code: WordPress multisite experiments
Let's code: WordPress multisite experimentsLet's code: WordPress multisite experiments
Let's code: WordPress multisite experimentsJonathan Bossenger
 
Let's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and CapabilitiesLet's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and CapabilitiesJonathan Bossenger
 
Let's code! What Happens When You Make Theme Changes
Let's code! What Happens When You Make Theme ChangesLet's code! What Happens When You Make Theme Changes
Let's code! What Happens When You Make Theme ChangesJonathan Bossenger
 
Let's code: custom content & custom capabilities
Let's code: custom content & custom capabilitiesLet's code: custom content & custom capabilities
Let's code: custom content & custom capabilitiesJonathan Bossenger
 
Developing for multisite
Developing for multisiteDeveloping for multisite
Developing for multisiteJonathan Bossenger
 
Preventing Common Security Vulnerabilities
Preventing Common Security VulnerabilitiesPreventing Common Security Vulnerabilities
Preventing Common Security VulnerabilitiesJonathan Bossenger
 
Using Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptxUsing Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptxJonathan Bossenger
 
Let's code! Converting a Shortcode into a Block
Let's code! Converting a Shortcode into a BlockLet's code! Converting a Shortcode into a Block
Let's code! Converting a Shortcode into a BlockJonathan Bossenger
 
Internationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptxInternationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptxJonathan Bossenger
 
Let's code: extending the WP REST API - modifying responses
Let's code: extending the WP REST API - modifying responsesLet's code: extending the WP REST API - modifying responses
Let's code: extending the WP REST API - modifying responsesJonathan Bossenger
 
Preventing CSRF Security Vulnerabilities.pptx
Preventing CSRF Security Vulnerabilities.pptxPreventing CSRF Security Vulnerabilities.pptx
Preventing CSRF Security Vulnerabilities.pptxJonathan Bossenger
 

Similar to Common WordPress APIs_ Global Variables (20)

Custom Tables in WordPress
Custom Tables in WordPressCustom Tables in WordPress
Custom Tables in WordPress
 
The WordPress HTML API
The WordPress HTML APIThe WordPress HTML API
The WordPress HTML API
 
The WordPress Create Block tool
The WordPress Create Block toolThe WordPress Create Block tool
The WordPress Create Block tool
 
Testing WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer editionTesting WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer edition
 
What’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptxWhat’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptx
 
Help test WordPress - developer edition
Help test WordPress - developer editionHelp test WordPress - developer edition
Help test WordPress - developer edition
 
Testing plugins for PHP 8
Testing plugins for PHP 8Testing plugins for PHP 8
Testing plugins for PHP 8
 
The WordPress Database
The WordPress DatabaseThe WordPress Database
The WordPress Database
 
Debugging in WordPress
Debugging in WordPressDebugging in WordPress
Debugging in WordPress
 
Let's code: WordPress multisite experiments
Let's code: WordPress multisite experimentsLet's code: WordPress multisite experiments
Let's code: WordPress multisite experiments
 
Let's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and CapabilitiesLet's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and Capabilities
 
Let's code! What Happens When You Make Theme Changes
Let's code! What Happens When You Make Theme ChangesLet's code! What Happens When You Make Theme Changes
Let's code! What Happens When You Make Theme Changes
 
Let's code: custom content & custom capabilities
Let's code: custom content & custom capabilitiesLet's code: custom content & custom capabilities
Let's code: custom content & custom capabilities
 
Developing for multisite
Developing for multisiteDeveloping for multisite
Developing for multisite
 
Preventing Common Security Vulnerabilities
Preventing Common Security VulnerabilitiesPreventing Common Security Vulnerabilities
Preventing Common Security Vulnerabilities
 
Using Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptxUsing Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptx
 
Let's code! Converting a Shortcode into a Block
Let's code! Converting a Shortcode into a BlockLet's code! Converting a Shortcode into a Block
Let's code! Converting a Shortcode into a Block
 
Internationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptxInternationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptx
 
Let's code: extending the WP REST API - modifying responses
Let's code: extending the WP REST API - modifying responsesLet's code: extending the WP REST API - modifying responses
Let's code: extending the WP REST API - modifying responses
 
Preventing CSRF Security Vulnerabilities.pptx
Preventing CSRF Security Vulnerabilities.pptxPreventing CSRF Security Vulnerabilities.pptx
Preventing CSRF Security Vulnerabilities.pptx
 

More from Jonathan Bossenger

Common WordPress APIs_ HTTP API.pptx
Common WordPress APIs_ HTTP API.pptxCommon WordPress APIs_ HTTP API.pptx
Common WordPress APIs_ HTTP API.pptxJonathan Bossenger
 
Testing your plugins for PHP version compatibility
Testing your plugins for PHP version compatibilityTesting your plugins for PHP version compatibility
Testing your plugins for PHP version compatibilityJonathan Bossenger
 
WordPress Coding Standards
WordPress Coding StandardsWordPress Coding Standards
WordPress Coding StandardsJonathan Bossenger
 
Managing a WordPress Multisite Network
Managing a WordPress Multisite NetworkManaging a WordPress Multisite Network
Managing a WordPress Multisite NetworkJonathan Bossenger
 
Introduction to WordPress Multisite Networks
Introduction to WordPress Multisite NetworksIntroduction to WordPress Multisite Networks
Introduction to WordPress Multisite NetworksJonathan Bossenger
 
Custom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptxCustom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptxJonathan Bossenger
 
Developing WordPress User Roles and Capabilities
Developing WordPress User Roles and CapabilitiesDeveloping WordPress User Roles and Capabilities
Developing WordPress User Roles and CapabilitiesJonathan Bossenger
 
Creating a WordPress multisite network
Creating a WordPress multisite networkCreating a WordPress multisite network
Creating a WordPress multisite networkJonathan Bossenger
 
Extending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilitiesExtending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilitiesJonathan Bossenger
 
WP REST API - custom routes and endpoints
WP REST API - custom routes and endpointsWP REST API - custom routes and endpoints
WP REST API - custom routes and endpointsJonathan Bossenger
 
WP REST API - modifying responses
WP REST API - modifying responsesWP REST API - modifying responses
WP REST API - modifying responsesJonathan Bossenger
 

More from Jonathan Bossenger (11)

Common WordPress APIs_ HTTP API.pptx
Common WordPress APIs_ HTTP API.pptxCommon WordPress APIs_ HTTP API.pptx
Common WordPress APIs_ HTTP API.pptx
 
Testing your plugins for PHP version compatibility
Testing your plugins for PHP version compatibilityTesting your plugins for PHP version compatibility
Testing your plugins for PHP version compatibility
 
WordPress Coding Standards
WordPress Coding StandardsWordPress Coding Standards
WordPress Coding Standards
 
Managing a WordPress Multisite Network
Managing a WordPress Multisite NetworkManaging a WordPress Multisite Network
Managing a WordPress Multisite Network
 
Introduction to WordPress Multisite Networks
Introduction to WordPress Multisite NetworksIntroduction to WordPress Multisite Networks
Introduction to WordPress Multisite Networks
 
Custom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptxCustom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptx
 
Developing WordPress User Roles and Capabilities
Developing WordPress User Roles and CapabilitiesDeveloping WordPress User Roles and Capabilities
Developing WordPress User Roles and Capabilities
 
Creating a WordPress multisite network
Creating a WordPress multisite networkCreating a WordPress multisite network
Creating a WordPress multisite network
 
Extending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilitiesExtending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilities
 
WP REST API - custom routes and endpoints
WP REST API - custom routes and endpointsWP REST API - custom routes and endpoints
WP REST API - custom routes and endpoints
 
WP REST API - modifying responses
WP REST API - modifying responsesWP REST API - modifying responses
WP REST API - modifying responses
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo GarcĂ­a Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Common WordPress APIs_ Global Variables