Is there any resource to explain all decisions made on WordPress?

Is there any resource to explain all decisions made on WordPress? No, there is none, and it’s rare for an open source project to have one, especially one of WordPress’ age. For example, <br>, <ol type=”a”> don’t work. But they do work, and there is even code to explicitly allow them and enable them in … Read more

Unexpected number of loops in while

This is because have_posts() is for the main loop, and not your custom query. Prefixing each use of have_posts() and the_post() with $WatchListQuery-> will fix it: if ( $WatchListQuery->have_posts() ) { while ( $WatchListQuery->have_posts() : $WatchListQuery->the_post();

Blocking admin-ajax.php from outside domain

If the point of the file is to allow the website to asynchronously post data why would it even be allowed to be accessed directly, especially from an ip that is not the ip of the site itself? AJAX requests come from the user’s IP address, not the site’s, because an AJAX request is by … Read more

Custom Post Types Do Not work on this permalink setting https://somedominaname.com/%category%/%postname%/

The Permalink structure setting on the Permalink Settings admin page is only applied to the default post type, i.e. post. For custom post types (CPTs), you can set the permalink structure (for posts in your CPT) when registering your CPT, via the rewrite argument for register_post_type(). But, if you want to use %category%/%postname% with your … Read more

Why does $_GET return values but get_query_var does not?

Because they do different things and source their data from different places. $_GET is for URL parameters, values passed via HTTP GET. get_query_var is for fetching the query variables of the main post query aka the WP_Query object. Query variables and GET values are not the same thing. Query variables usually get their values either … Read more

How to set autoload from “yes” to “no” _transient_wp_core_block_css_files

Don’t bother messing the with autoload on the transient. If you’re truly not using blocks at all, just unhook the function that creates the transient and uses it to register the style handles: remove_action( ‘init’, ‘register_core_block_style_handles’, 9 ); Just be aware that if you do use blocks, their stylesheets will not load until you let … Read more

How to disable pagination in WordPress’ API results?

When calling WP_Query directly, you should use posts_per_page and not numberposts — it is an alias for posts_per_page, but only used with get_posts(). // These work, but I strongly advise against using 999: $fs_ski_resorts = get_posts( array( ‘numberposts’ => 999 ) ); $fs_ski_resorts = get_posts( array( ‘posts_per_page’ => 999 ) ); $the_query = new WP_Query( … Read more