Add term of current custom post type to admin body class using admin_body_class

I am trying to add the current custom post type term to the body class of my WordPress admin page. So when I am viewing an existing custom post type that has been assigned a term it will add that term to the body class.

I have found the following code but cannot get it to work for me:

add_filter( 'admin_body_class', 'rw_admin_body_class' ); function rw_admin_body_class( $  classes ) {     if ( 'post' != $  screen->base )         return $  classes;      global $  post;     $  terms = wp_get_post_terms( $  post->ID, 'product_cat', array( 'fields' => 'all' ) );     $  terms = wp_list_pluck( $  terms, 'slug' );     foreach ( $  terms as $  term )     {         $  classes .= ' my_taxonomy-' . $  term;     }      return $  classes; } 

Any pointers on how to get this working?

Do you gain current HP when you level up?

Let’s say your hero is at max HP and he/she is levelling up.

PHB p. 15, “Beyond first Level” says about HP increase when levelling up:

add the total to your hit point maximum

Will she/he need healing afterwards? In other words, does “add to your hit point maximum” imply that your current HP doesn’t change at this moment?

Return product list based on current product attribute

I have modified my single-product.php and want to pop in a block of other products that share the same brand name which I have specified in a product attribute called ‘brand’.

This is my code so far but it is returning all the products and NOT filtering by the pa_brand.

<!-- Custom 4 up product filtered by Brand attribute -->         <ul class="products">                 <?php             $  args = array(                 'post_type' => 'product',                 'posts_per_page' => 4,                 'taxonomy' => 'pa_brand',                 'field'    => 'slug',                 'terms'    => $  product->get_attribute( 'brand' )                 );             $  loop = new WP_Query( $  args );             if ( $  loop->have_posts() ) {                 while ( $  loop->have_posts() ) : $  loop->the_post();                     wc_get_template_part( 'content', 'product' );                 endwhile;             } else {                 echo __( 'No products found' );             }             wp_reset_postdata();         ?>     </ul><!–/.products–> 

GLES3 – GL_INVALID_OPERATION: Operation illegal in current state (Unity Android native)

I use Unity(editor 2020.1.8f1). My application use android native .so lib that use GLES3. In order to use it first of all I have done these steps :

first: go to Project Settings >>> Player >>> Other Settings.  second: find "Auto Graphic API" and uncheck it.  third: Now you can see a new panel just below the "Auto Graphic API". It's a list of "Graphics APIs". Remove all graphics APIs and just add "OpenGLES3". 

Then in android CMakeList.txt file I marked that I use GLES3

... target_link_libraries(         libcocodec         GLESv3               <----------------  THIS LINE         decoder_engine_lib         $  {log-lib} ) ... 

And there is a usage :

void RenderAPI_OpenGLCoreES::EndModifyTexture(         void* textureHandle,         int textureWidth,         int textureHeight,         int rowPitch,         void* dataPtr,         bool destroy) {     GLuint gltex = (GLuint)(size_t)(textureHandle);     // Update texture data, and free the memory buffer     glBindTexture(GL_TEXTURE_2D, gltex);          GLenum format = GL_RG;      glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, textureWidth, textureHeight, format, GL_UNSIGNED_BYTE, dataPtr);     if (destroy)         delete[](unsigned char*)dataPtr; } 

and error message I get is –

2020-11-08 10:51:46.966 1512-1930/com.co.unityandroidplayer E/Unity: OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_OPERATION: Operation illegal in current state      (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 358) 

I assume that something wrong with usage of GLenum format = GL_RG;, because (just for test) – if I use GLenum format = GL_ALPHA; I don’t get any errors (as well as expected result). Looks like gles3 doesn’t know what is GL_RG format.

What am I doing wrong?

Legacy CE vs current

I recently updated a SQL server to current version. I have major performance issue with some query for example this query takes 8 seconds with legacy CE:

https://www.brentozar.com/pastetheplan/?id=SyzoJMGSw

But 5 minutes with CE 150:

https://www.brentozar.com/pastetheplan/?id=Bkj1RbGrP

I updated statistics for the whole DB and run fullscan update to the tables in this query.

Any idea how can I fix this performance issue?

Thanks in advance!

Peter

What are some good feats for sorcerer’s from current or any other previous versions of Dnd? [closed]

I am playing a shadar kai, Giant Soul(strom) sorcerer(level 06).
I took the crossbrow experties feat at level 1.
I have +4 mod on both Dex and Cha, and a +3 mod on Con. (I have +6 bonus on Con saves).
With haste, shield, absorb element and shadar kai’s necrotic damage resistance I fight in melee.

My my usual attack pattern is-
1.Go in mele use shocking grasp
2.haste atk-use a hand crossbow
3.bonus action-another hand crossbow atk(Through crossbow experties feat)

Why min-maxing? Because eveeryone in the party does. If I don’t I will feel useless in combat. The DM has allwed a lot of previous version material to the other players.

I have already thought of war caster, but with the defence I have conscentration is not a big problem. Also, if shocking grasp hits I can back off without provoking opportunity attack and have the 60′ movement due to haste.

With this build of mine what would be the best feat for me(any verion/any book)?

What is the current situation of Cyric in the Forgotten Realms?

I am DMing a homebrew campaign in the Forgotten Realms, the subplot involving the cleric is heavily linked to the past history and current situation of some of the gods. I am now interested in the fate of Cyric.

In the year of the Blue Fire (1385 DR) Cyric, with the aid of Shar, murdered Mystra, causing the Spellplague. We can read in Grand History of the Realms (page 159) that

Tyr, Lathander, and Sune move against Cyric and successfully imprison the Black Sun in his Supreme Throne, under a sentence of house arrest to last one thousand years.

This is confirmed in the Forgotten Realms Campaign Guide (page 74) for DnD 4th edition:

Tyr, Lathander, and Sune united to imprison him in his nightmarish playhouse of a plane, the Supreme Throne, where he remains to this day, alone and increasingly insane.

I read to this day as the Year of the Ageless One, i.e. 1479 DR, as written in the same guide at the very beginning of the introduction via Elminster’s words. The Sword Coast Adventure’s Guide sets the current year to 1489, then only 104 years has passed since Cyric was imprisoned. At page 27 there is only a little paragraph about Cyric and its church, without any details about the imprisonment.

I wonder what are the consequences of its imprisonment on its church and worshippers, since it seems there are not anyone. Is Cyric actually free and he can roam wherever he wants? Or is he still confined in the Supreme Throne?


I know that it is a homebrew campaign and (theoretically) I can do whatever I want, but I prefer to be as faithful as possible to the official campaign setting.

If you have any details coming from current adventures (Princes of Apocalypse, Rise of Tiamat, etc), please use the spoiler quote.

Hi I need a query to get both Max Date and next date after the current date

Select ci.CustomerID, max(dd.DueDate) from tblcustomerinfo ci  join tblduedates dd on dd.id=ci.id group by ci.CustomerID   tblCustomerinfo      **customerid**          **type** 384953              visa 938494              visa 337723               mc  tblDueDate CustomerId            duedate 384953              12/30/2020 384953              09/30/2020 384953              07/30/2020 938494              08/30/2020 938494              07/30/2020 337723              05/30/2020 337723              03/30/2020 

Results should be

384953                9/30/2020 938494                8/30/2020 337723                5/30/2020 

Algorithm for drawing the horizon given the current coordinates, elevation and field of view

I have a large database containing coordinates along with an elevation number. If I am a person looking in some direction (0-360) with an n degree field of view, and located at some coordinate and at some elevation, how can I generate an image representing the horizon? What algorithm should I use?