This is mostly pure PHP, but it does have WordPress twist.
PHP has number of superglobal variables, that contain information relevant to current request. Out of those:
$_GET
contains info from URL (HTTP GET request)$_POST
info from form submission (HTTP POST request)$_COOKIES
about cookies set- and
$_REQUEST
is combination of the above (according to docs$_COOKIES
can be commonly configured to skip for better security)
However WP enforces its own logic – during load process wp_magic_quotes()
processes variables to emulate magic quotes setting and enforces $_REQUEST
to contain combination of $_GET
and $_POST
, no matter what PHP configuration says.
So in WordPress environment it will contain GET and/or POST request data. What data exactly that is will depend entirely which page you are on and what is happening on it.
Related Posts:
- Call global variable array() in woocommerce child/template
- How to modify a global variable in a function and use it on another function?
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- global $product is empty string when passed into function
- Custom global variable not working in function
- How can one use variables in a template or template part without polluting the global scope?
- How to add elements to an empty array in PHP?
- How to set and use global variables? Or why not to use them at all
- WordPress Theme variables scope
- Does an activated plugin automatically mean its methods are available to other WP functions?
- Custom plugin: Trying to show saved data on frontend
- How to call a function only once (global variable scope)
- Pass a PHP variable to another file
- How to store the_title() into a variable to reutrn the value, not just echo it
- Create a global variable for use in all templates
- Variables declared in header not available in other includes
- How do I make my function add variables/values to the $post object?
- Filter the blog title displayed in the header
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- where to include a php file
- How do I know what variables are passed in a filter/action and what their meaning is?
- JavaScript, best way to use data from the loop
- How to set status codes such as 401 and 403?
- When would you use $_post instead of $post?
- Can I use HTTP POSTs? Is there a better alternative?
- How to put a form with php code into a variable or shortcode?
- Apply class to every third list item? [duplicate]
- Where is this function’s callback getting its arguments from?
- persist a variable set in header.php all the way down to footer.php
- Get access to variable from previous pageview, excluding ajax-calls
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- I am receiving a pluggable.php warning sign on my only http:// page
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Insert page content into another page with a changed variable
- Pass Variables or Variable Place-Holder from Editor to PHP
- How to access or parse key/values that have “string”
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- Local WordPress with WAMP downloads files out of Nowhere
- javascript variable to wordpress php variable
- How to reference PHP in Javascript
- Store and Change Session variable – PHP SESSION VARIABLE
- Overide Variable in Child Theme
- echo var into wp_query
- how can I include some custom variable from functions.php?
- Dynamically adding filters
- ‘global’ not working in wordpress?
- Php file that doesn’t recognize wordpress functions
- PHP variables in a post?
- WordPress is removing query variables like page, p from the URL of a custom static page
- How to send a php var to jQuery Ajax call with two different file
- Unable to display multiple parameters from url by javascript through shortcodes
- How to check a variable Changes
- Reading URL Parameters
- Display values of current POST request on page
- Can’t pass var from php wp_ajax into ajax script : result undefined or null
- Define global custom post
- Hide payment method based on user role AND minimum cart value
- WordPress How do I pass a variable from one add_action to another?
- Best way to use variables in multiple functions?
- Trying to add some custom text into WordPress Post title via function.php
- Reduce Stock Based on Custom Variation Field Rather than Attribute (Working Script)
- How do I fix Undefined variable using $_POST in function?
- Sudden Upload HTTP errors, PHP uploads and memory limits are already to high to my taste. Anything else?
- How to change the value of a variable using input field?
- Require advice handling a URL redirect from a Third Party. URL Params need to populate and then forward to payment
- How to find php variable of wordpress theme settings
- Add class to all meta boxes for a custom post type
- My WP Website Shows HTTP ERROR 500
- Passing parameter from the current URL to redirect to another url
- Undefined variable & issue with smof_data
- Pulling a variable into the wp_nav_menu function
- Where can I find the declaration of `$_wp_theme_features`?
- Child theme functions.php file change database entries
- global $post inside plugin query messes up every new post page in wp-admin
- Custom Taxonomy Link Text Echo Name Not Slug
- Editing Global Variables from Inside Functions
- how to add number value in front for variable [closed]
- Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?
- WordPress $GLOBALS and PHP $GLOBALS
- key( $GLOBALS[‘wp_registered_sidebars’] ) is always showing the same value
- Difference in Get Variable Location
- If I define a variable in header.php, how do I make it available to templates?
- Shortcode not passing variable to included file
- ACF allow zero as a value
- Can’t get options with $data[‘variable’]
- Using the wp_remote_post response body
- PHP Use Declared array Variable inside already Declared Array
- Import and use a variable in additional settings of Contact Form 7 [closed]
- Suppress errors when using global function
- Use ajax response in PHP function
- WP query with variables gives no result for specific user
- Using global variables
- How to make my scroll bar show under condition
- PHP Warning: Attempt to read property “id” on null
- How to access admin menu labels and links on front-end?
- Encountering 400 Bad Request Error When Sending Form Information to API through Elementor
- How to get default variation ID (woocommerce)
- Get check box values inside array for use in posting form data
- How can I save the HTML output of a WP_Query function as a variable?