How can I change field values of posts before displaying

I have wordpress project with woocommerce. What I’m trying to achieve is to change values before displaying them on the view page.

For example depending on session/cookie I want to change the language of post title and content

Using the hooks the_title, the_content I was able to achieve it. The problem is when I try to do the same for the_excerpt hook, it’s just never called.

Relevant code from functions.php :

add_filter('the_title', 'custom_lang_title');  function custom_lang_title($  title){     if($  otherlang){         return get_field('lang_title');     }else{         return $  title;     } }  add_filter('the_content', 'custom_lang_desc');  function custom_lang_desc($  content){     if($  otherlang){         return get_field('lang_content');     }else{         return $  content;     } }   //The code below does not work  add_filter('the_excerpt', 'custom_lang_excerpt');  function custom_lang_excerpt($  desc){     if($  otherlang){         return get_field('lang_excerpt');     }else{         return $  desc;     } } 

I’m completely new to wordpress, so if don’t really know what other info can be helpful. I can provide more info on request.

We’re deleting stale AD accounts for a company but owner wants to see the network files of AD users before deciding which accts to delete

We are deleting stale AD accounts for the companies we work for.

I contacted the owner of a particular company to help us determine which AD accounts we can delete. He said he’d first like to see what files the deletion candidates have stored on the network to help decide which accounts are OK to delete.

We have a domain admin account. Is there a way to access AD User files? Is there a PowerShell command (or GUI app) to list the files of each AD user in a clean/presentable format that we could present to the owner?

I think he’s only really concerned with the contents of each user’s Home directories (the directories containing the Documents, Music etc. folders) — and not network shares or shared folders users may happen to have access to — because the Home directories are the only directories risking deletion as a result of deleting their accounts, right?

Were the gith originally human before the illithids enslaved them?

Firstly, I will point out that I am only really familiar with D&D 5e and the video game Neverwinter Nights 2 (which is based on D&D 3.5e and set in the Forgotten Realms; incidentally, if the answer to this question would be different for different settings, assume Forgotten Realms).

In that video game (since the githyanki feature quite heavily, certainly in the first third of the game), one of the characters (Aldanon the Sage) claims that the gith were once human before the illithids enslaved them (see this gameplay video, 4:13):

Ages ago, the ancestors of the githyanki were human, and inhabited another plane of existence, where they were enslaved by the illithids, or mind flayers.

However, this is just a video game character, not a source book or similar, so this information is hardly credible. But this information may have come from somewhere credible, since I only know of the official information from D&D 5e.


Furthermore, it somewhat contradicts what D&D 5e has to say on the matter; from the Monster Manual (p. 158):

Before there were githyanki or githzerai, these creatures were a single race enslaved by the mind flayers. […] Whether these tall, gaunt creatures were peaceful or savage, cultured or primitive before the mind flayers enslaved and changed them, none can say. Not even the original name of their race remains from that distant time.

This seems to heavily imply that what the gith were before the illithids enslaved them is simply not known. Perhaps they were human? Perhaps they weren’t? The point is, we don’t know (meaning, there is no canon information).

I believe this is the most information we have about the origin of the gith in D&D 5e (since, although there’s a whole chapter on the gith in Mordenkainen’s Tome of Foes, it doesn’t seem to talk about much before their uprising against the illithids), so I’m hoping that earlier editions of D&D may have more information (according to the gith tag information, they go back as far as AD&D 1e, so there should be lots of lore to go on).


There is also this quote from the Forgotten Realms wiki’s page on the gith:

Some sages claimed that they were once descended from humans,[5][1][13][14] while others maintained that their original race was in fact unknown.[2][15][16]

and although it does include references, I don’t own most of those books and therefore cannot verify them; also the quote itself is vague (i.e. “some sages claimed”, exactly where from Mordenkainen’s Tome of Foes did they extract that, because my reading of it doesn’t show up anything like that, although I was only skim reading it and may have overlooked something).

Finally, there is also this D&D Beyond video with Mike Mearls, where he also claims that the gith were once human (around 5:55), but I’d prefer to have that confirmed in a source book rather than just a passing comment by Mike Mearls (especially since it seems to contradict the D&D 5e Monster Manual, at the very least).


Is there any canon information from any edition of D&D to support the claim that the gith were once human before the illithids enslaved them?

Save NDSolve output before break down point?

When NDSolve breaks down at a certain point and returns

NDSolve::ndstf: At t == 0.0002928741551966316623688760272534580839493029147882536749`40., system appears to be stiff. Methods Automatic, BDF, or StiffnessSwitching may be more appropriate.

is there a way to save or plot the solution from t=0 up to t == 0.0002 and see what went wrong?

RDP with self-signed cert requiring password before launching display

I’ve noticed that the search engine Shodan grabs screenshots from hosts running an RDP service, even if they offer a certificate.

To my understanding, the certificate is used to authentify the server, and encrypt the traffic sent and received (exactly like they are used in HTTPS), and thus should be irrelevant to the protection of hosts exposing RDP to the internet, but when I try to connect to such a service using xfreerdp, I get prompted for a password before I get to where the screenshot was taken, and then the error message : freerdp_set_last_error ERRCONNECT_LOGON_FAILURE [0x00020014].

I read that Shodan does not try passwords, it just grabs screenshots from accessible targets without credentials How is Shodan able to grab such screenshots? or what does xfreerdp do instead of launching the RDP display?

Can I decide to use the human trait variant before or after rolling stats?

The Players Handbook has the following optional traits for humans:

Variant Human Traits

If your campaign uses the optional feat rules from chapter 7, your Dungeon Master might allow these variant traits, all of which replace the human’s Ability Score Increase trait.

Ability Score Increase. Two different ability scores of your choice increase by 1.

Skills. You gain proficiency in one skill of your choice.

Feat. You gain one feat of your choice.

(Player’s Handbook, page 31)

Can I decide to use this trait after rolling my stats, or do I have to make that decision before?

I ask because the stats that are rolled could result in big gains in total modifiers if all stats are increased, with a lot of odd numbers, but if you only get 2 or less odd numbers, increasing the other skills will not result in any increase to the total skill modifiers you end up with, and thus taking the optional traits would essentially net you a free feat and skill proficiency.

To illustrate, suppose I rolled 15, 13, 12, 11, 11, 9.
In this example, my modifiers would be +2, +1, +1, +0, +0, and -1 (total 3).
By taking the default trait, I would end up with 16, 14, 13, 12, 12, 10, and my modifiers would be +3, +2, +1, +1, +1, +0 with a total of 8 – a big improvement, whereas by taking the optional traits, I could only increase my modifiers 2, to 5 total. So in this circumstance I would prefer to take the overall increase.

Suppose instead I rolled 16, 14, 13, 12, 10, 10 with modifiers +3, +2, +1, +1, +0, +0.
In this instance taking the default trait I would end up with 17, 15, 14, 13, 11, 11 and modifiers +3, +2, +2, +1, +0, +0. This only net me an increase of 1 to my modifiers, which would be the same as taking the optional traits.
Hence in this situation, I would want to take the optional traits because the feat and skill proficiency are essentially free.

Can a necromancer animate dead a creature with sentience that agreed before death to be animated?

If a necromancer was to make a deal with like 4 people before a fight that the necromancer could animate them if they die during the fight, and then those same 4 people were to die, would those 4 people be reanimated more friendly than most skeletons/zombies or would they just have the regular aggression?

Validate functions before inserting then into functions.php

I’d like to know if the functions below follow best practices in terms of ensuring the best performance and security before deploying to the main site.

1. Remove paged category description

add_action( 'wp', 'tu_remove_paged_category_description' ); function tu_remove_paged_category_description() {     $  page = (get_query_var('paged')) ? get_query_var('paged') : 1;     if ( 1 !== $  page ) {         remove_action( 'generate_archive_title', 'generate_archive_title' );         add_action( 'generate_archive_title', 'tu_custom_paged_archive_title' );     } }  function tu_custom_paged_archive_title() {     ?>     <header class="page-header">         <h1 class="page-title">             <?php the_archive_title(); ?>         </h1>     </header>     <?php } 

2. Allow HTML editing of author biography

remove_filter('pre_user_description', 'wp_filter_kses');   add_filter( 'pre_user_description', 'wp_filter_post_kses' ); 

3. Limit number of posts on first page of selected categories

add_action( 'pre_get_posts', function( $  query ) {     if ( ! is_main_query() || is_admin() ) {         return;     }     if ( ! is_paged() && is_category(array (2 , 3) )) {         $  query->set( 'posts_per_page', 8 );     } } ); 

4. prevent the category widget from using the category description as the list item title attribute

function mbf_disable_cat_desc_widget_list_titles ( $  cat_args ) {     $  cat_args[ 'use_desc_for_title' ] = 0;     return $  cat_args; } add_filter( 'widget_categories_args', 'mbf_disable_cat_desc_widget_list_titles' ); 

5. Create shortcode by listing subcategories belonging to that category

function mbf_subcategories($  atts, $  content = null ){extract(shortcode_atts(array('count'=>'10','show_count' =>0,'hide_empty'=>0), $  atts)); $  parents = array(); if(is_category())   { //If on a Category Archive Page, show its subcategories, if any         $  cat = get_category(get_query_var('cat'), false);         $  id = ($  cat->category_parent==0)? $  cat->cat_ID : $  cat->category_parent;          if (get_term_children($  id, 'category') != "") {         //List of subcategories with parent category in title.             $  args =( array('show_option_none'=>'','title_li' => '','echo'=>0,'show_count'=> $  show_count,'number' => $  count,'hide_empty'=>$  hide_empty,'child_of'=>$  id));              $  output = '<ol>'.wp_list_categories($  args).'</ol>';          }     }     return $  output; } add_shortcode('mbf_subcategories', 'mbf_subcategories');