How to change Route respond To A specific Path?

To increase site loading time and decrease the pressure on my website I have decided to host files(js,css,images) in other hosting, like google storage or amazon aws, problem is that I already published a lot of posts that includes images other files in the html, like:

<img src="site.example/wp-content/uploads/images/image.png"> 

i can’t go all over the posts to change the src attribute, so I want to change my route code so every time a wp-content or wp-includes files is requested, it will redirect it to the host where my media files are, something like:

    if(str_contains(path, 'wp-content') || str_contains(path, 'wp-includes')){       redirect("host.example".path);     } 

how to delete specific range of data from system queue data table?

due to sudden increase of my database .mdf file we check there are 4 internal queue message table are increase unexpectedly. so we decided to delete some range of data from these table.

we try this code:

declare @c uniqueidentifier while(1=1) begin     select top 1 @c = conversation_handle from dbo.queuename     if (@@ROWCOUNT = 0)     break     end conversation @c with cleanup end   

but its try to delete all data and due to space limitation the query cannot execute. my internal message queue table :

enter image description here

enter image description here

how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard

I want to display for the admin when a user visits a page and when he leaves that page

the page is for example test.test/my-dashboard. and it’s only available for the logged in users. the admin knows to know the time when the user is in that page and the time the user leaves that page.

thanks in advance and excuse my language.

How do you run code on a specific page without missing the init hook?

The earliest that functions such as get_permalink or is_page are available is parse_query (afaik). Then I thought, ok, clearly, I can’t say if( is_page('myPage') ) { add_action( 'init'... // because is_page will always resolve to false.

So then I thought, well, how about wrapping parse_query inside init like so:

add_action( 'init', function() {     add_action( 'parse_query', function() use() {         if( is_page( 'myPage' ) ) { //     }, 10 ); }, 10 ); 

Well, that still does nothing. The code works, but hooking into init there doesn’t really work. My goal here is to make use of items that need to launch/are available on init:10. So, I said, ok, just pass them, right?

add_action( 'init', function() {   $  something_i_need_from_init_10 = //do something.   add_action( 'parse_query', function() use( $  something_i_need_from_init_10 )   // } 

Which works, now, there are two cases that you’ll use this for:

  1. Getting something. If it’s available on init:10, isn’t it available on parse_query since parse_query come after? Sure, for most things, but remember that WP core itself gets rid of certain get_post_* functionality once it hits certain actions. Perhaps you have a service container that works well with WP and a service is only available on init:10.
  2. Doing something. Perhaps something needs to fire here. If so, this still works.

But all of this is clunky to write.

Is there no way to tell WP to run code on init, on a certain page only? Just looking at the link won’t do. There are rewrite rules, link formats and so on that one has to take care of and that probably don’t load until later on.

Ultimately, it’d be nice if all I had to write was:

add_action( 'init', function() {   if( is_page( 'myPage' ) ) {     //do stuff   } } 

What can one do when trying to design this way?


I don’t know how to figure it myself, but perhaps pipelining this process through the page.php / single.php pages will work. I assume WP has to figure out very early on what page, with what template it has to serve for any given link, for which it calls these 2 (usually).

Do spells like burning hands specify specific non-material components?

In "Does Burning Hands really require touching thumbs?", it has been established that burning hands does indeed require touching thumbs. A question that is danced around there is, "is the touching thumbs the somatic component?" This question also extends to spells like dissonant whispers (verbal component) and message (verbal/somatic component). In other words, when a spell specifies something in its description, outside the component list, that could be nonetheless be construed as the component, is it in fact a component, or even the component?

I’m inclined to think such descriptions are the component, but am unsure. This does have some weird implications if so, like "how loud does one dissonantly whisper?" and "can someone else hear my whispered message?" (I don’t need these answered here; I just include them because they are related, depending on the answer.)

Are there any specific rules about how to prepare spells?

[This question is related to my Dwarven Cleric character.]

In the Player’s Handbook, it says that all spells need to be prepared in advance before they can be used. I get that this is done while resting but does it matter how long the rest is (i.e. long or short) as it doesn’t seem to say how long each spell takes to prepare.

Also, are there any specific mechanisms for preparing spells, other than telling my DM "In this rest I will prepare X spells"?