Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

globals

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

August 5, 2022 by Magenaut

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

Categories Q&A, Wordpress Tags forms, globals, php, variables Leave a comment

How to deal with global information without creating a Singleton class

August 5, 2022August 4, 2022 by Magenaut

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

Categories Q&A, Wordpress Tags globals Leave a comment

What is the global $wp object used for?

August 5, 2022August 4, 2022 by Magenaut

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

Categories Q&A, Wordpress Tags globals Leave a comment

Should we trust the post globals?

August 5, 2022August 4, 2022 by Magenaut

@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?

Categories Q&A, Wordpress Tags globals, loop, posts, query, wp-query Leave a comment

How to: inspect global variables in WordPress

August 5, 2022August 4, 2022 by Magenaut

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 because it’s needed pretty often over here at WA. I just wanted to have it as a fav to link over here (people often don’t take a look at github … Read more

Categories Q&A, Wordpress Tags globals Leave a comment

WordPress Multisite – global categories

August 4, 2022August 3, 2022 by Magenaut

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.

Categories Q&A, Wordpress Tags categories, globals, multisite Leave a comment

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

August 4, 2022August 3, 2022 by Magenaut

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.

Categories Q&A, Wordpress Tags functions, globals, php Leave a comment

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

August 4, 2022August 3, 2022 by Magenaut

I made a WordPress plugin like this:

Categories Q&A, Wordpress Tags actions, globals, oop, php Leave a comment

When to use global $post and other global variables?

August 4, 2022August 3, 2022 by Magenaut

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.

Categories Q&A, Wordpress Tags globals, variables Leave a comment

How to set global variable in functions.php

August 3, 2022August 2, 2022 by Magenaut

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.

Categories Q&A, Wordpress Tags globals, thumbnails, urls, variables Leave a comment
Older posts
Page1 Page2 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress