Submit new posts to current category

i’m trying to Submit new posts to current category. For example on a wordpress site i select the category "Cars" and i see all the posts that belong to category "Cars" as archive page. In this time the current category is "Cars". If i use a form plugin to insert at front end the title and the body of a new post, is it possible to assign the current category on the new post?

thanks for the support.

Get all Gravity Form entry IDs for current user and display the highest value

I have a Gravity Form with a user registration plugin installed, so every time someone completes the form, they are added as a user and the submitted form is assigned an entry ID which is linked to that user. But whenever a user re-submits the form a new entry ID is created – there is a column in the "wp_gf_entry" table called "created_by" which contains the user ID for who submitted the form. So I figured I need to find currently logged in user ID, match it against the "created_by" column then find the highest value entry ID for that user, which I will then need to display in a shortcode.

I have figured out how to find the initial entry ID which is linked to the users meta details and display that inside the shortcode, see below.

  $  user_id = get_current_user_id();   $  key = 'entry_id';   $  single = true;   $  gform = get_user_meta( $  user_id, $  key, $  single );     echo do_shortcode('[gravitypdf id="5ffc7508269e7" entry="' . $  gform . '" text="Download"]'); 

This would work great if the entry ID got updated every time the user re-submits the form, as the entry ID would always stay the same, but a new entry ID gets created for every form submission.


That led me to searching for another solution which would update the same entry every time the user re-submitted the form, but I was at a lose and could only find the following gform_entry_id_pre_save_lead which after testing wouldn’t work for me and a new entry was created each time.

Ideally I would prefer the first solution, just in case the user needs to access an older entry. Although its not essential so all suggestions and possible solutions are welcome.

I’m relatively new to PHP, but feel like the solution Is not far away and feel like the use of the foreach loop and the max() function will help with looping through the array of entry IDs for current user and finding the max value in that array…I just can’t figure out how to get there with code!

Any help would be appreciated.

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/ 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:

But 5 minutes with CE 150:

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!


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.