Magenaut

Magenaut

A blog about Magento Development, Magento bug fixing, and more

Skip to content
Menu
  • Home
  • Notes
  • Tutorial
  • Bug fixing
  • Extension
  • Server
  • Q&A
  • About

Tag: globals

Q&APosted onAugust 5, 2022

What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?

I am trying to insert some php code to my WordPress website but it gives security warnings perhaps due to directly accessing $_POST variable.

Read More
Q&APosted onAugust 4, 2022August 5, 2022

How to deal with global information without creating a Singleton class

I am trying to walk away from the Singleton pattern when it comes to develop plugins for WordPress.

Read More
Q&APosted onAugust 4, 2022August 5, 2022

What is the global $wp object used for?

In the wordpress documentation for Global Variables, I did not find information about the $wp global variable.

Read More
Q&APosted onAugust 4, 2022August 5, 2022

Should we trust the post globals?

@toscho left a comment to this answer which had me thinking again. How much trust should we have in the global scope, specially regarding the post globals like $post?

Read More
Q&APosted onAugust 4, 2022August 5, 2022

How to: inspect global variables in WordPress

People are often confused about how to get data from global objects/variables Question: In which ways can you inspect global variables? This Q was written…

Read More
Q&APosted onAugust 3, 2022August 4, 2022

WordPress Multisite – global categories

Setting up a WP multisite instance – the client has an existing ontology / set of categories that they want to classify all content across the set of blogs. Also the desire is that any new categories would be added at the ‘network blog’ level and synced to the other blogs.

Read More
Q&APosted onAugust 3, 2022August 4, 2022

How to set and use global variables? Or why not to use them at all

UPDATE: My original question has been solved, but this is turning into a valid discussion about why not to use global variables, so I am updating the question to reflect that. The solution was <?php global $category_link_prop; echo esc_url( $category_link_prop ); ?> as @TomJNowell suggested.

Read More
Q&APosted onAugust 3, 2022August 4, 2022

Does an activated plugin automatically mean its methods are available to other WP functions?

I made a WordPress plugin like this:

Read More
Q&APosted onAugust 3, 2022August 4, 2022

When to use global $post and other global variables?

I am trying to understand when and why I should use the global $post variable.
I have tried to do the following on a post page, outside the loop, and as expected it works.

Read More
Q&APosted onAugust 2, 2022August 3, 2022

How to set global variable in functions.php

I want to be able to echo the URL of the featured image of a post and after looking some on the web I found the following which works fine when I put it in a loop in my front page template.

Read More

Posts navigation

Page 1 Page 2 Next Page

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 141 other subscribers

Recent Comments

  • anonymous on Fix libwacom9 dependency issue when upgrade Debian
  • sreedhar on Fix libwacom9 dependency issue when upgrade Debian
  • saintnick on Fix libwacom9 dependency issue when upgrade Debian
  • ranafoul on Fix libwacom9 dependency issue when upgrade Debian
  • John Fro on UFW rule from a list of IPs

Tags

actions ajax bash block-editor categories command-line custom-field custom-post-types custom-taxonomy customization database debian files filters functions hooks images javascript linux loop menus multisite permalinks permissions php plugin-development plugins post-meta posts rest-api security shell shell-script shortcode ssh terminal text-processing theme-development themes uploads url-rewriting users woocommerce-offtopic wp-admin wp-query

© Magenaut - The Magento Astronaut