Get_option use inside switch select option

I try to make inside theme custom admin panel a switch select option. but i cannot get the value of switch case. following is my code:

$  bannerchange = $  _POST['bannerchange'];  if( get_option('bannerchange') != get_option($  bannerchange)) {             $  bannerchange = update_option( 'bannerchange', get_option($  bannerchange));  }  <?php if(isset($  _POST['wphw_submit']) && $  chk):?>   <div id="message" class="updated below-h2">     <p>Content updated successfully</p>   </div>     <?php endif;?>       <form method="post" action="">  <select name="wphw_submit" onchange="this.form.submit()">      <option value="page1"<?php if ($  bannerchange == "page1") { echo " selected"; } ?>>Custom Departure</option>      <option value="page2"<?php if ($  bannerchange  == "page2") { echo " selected"; } ?>>Fixed Departure</option> </select> <noscript><input type="submit" value="Submit"></noscript>  </div> <input type="submit" name="wphw_submit" value="Save changes" class="button-primary" /> <?php  switch ($  bannerchange) {     case 'page2': ?>                  <p>two</p>          <?php         break;     case 'page1':         ?>         <p>one</p>         <?php         break;     }     ?> 

$ bannerchange get always undefined.

Is woo commerce the only option for product add ons and deposits?

I am getting ready to add a shop to my website. It will sell campers. I want people to be able to select the base model (sz) and then add optional items like tool boxes, hitch sz, etc. At "checkout" instead of collecting the full price, we just want to collect 10% of the total due. I think this can be done with Woocommerce. Is there a better way to do this? Any suggestions appreciated! Thanks!!!

Select arbitrary single value for GROUP BY: What’s the fastest option?

I have a query that I use to indicate locations in a map where there are overlapping points:

select     min(objectid) as min_objectid,     longitudex,     latitudey,     count(1) as count,     min(shape) as min_shape from     workorders group by     longitudex,     latitudey having     count(1) > 1 

In the mapping software that I use, I need to include columns like objectid and shape. For those columns, it doesn’t matter which of the grouped-by rows the values come from, just as long as there is a value.

Presently, I’m using min() to get an arbitrary value for those columns. However, I don’t know if that’s the fastest option since finding the minimum value would require calculation — and I wonder if that time spent is unnecessary.

What is the fastest option for getting an arbitrary/single value for GROUP BY in an Oracle query?

How does the Flames of Phlegethos racial feat interact with the sorcerer’s Metamagic option Empowered Spell?

If I have both the Flames of Phlegethos feat and the sorcerer’s Metamagic option Empowered Spell, can I re-roll the same die twice?

The description of the second benefit of the Flames of Phlegethos tiefling racial feat says (XGtE, p. 74):

When you roll fire damage for a spell you cast, you can reroll any roll of 1 on the fire damage dice, but you must use the new roll, even if it is another 1.

The description of the sorcerer’s Metamagic option Empowered Spell reads (PHB, p. 102):

When you roll damage for a spell, you can spend 1 sorcery point to reroll a number of the damage dice up to your Charisma modifier (minimum of one). You must use the new rolls.

You can use Empowered Spell even if you have already used a different Metamagic option during the casting of the spell.

Can you re-roll the same die with both features, or only once? That is, if you re-roll a die with one of these abilities, does the other ability let you re-roll it?

The "You must use the new roll" makes it sound like you cannot, but in general abilities can can override how other abilities work. Is the "keeping the new roll" restriction limited to re-rolls from that ability, or does it apply to all re-rolls from any source?

There is another interpretation of "You must use the new roll." There is a feat called Savage Attacker which reads:

Once per turn when you roll damage for a melee weapon attack, you can reroll the weapon’s damage dice and use either total.

If you compare this to the language in the previous two abilities, you see that the "re-roll and must use the new roll" could be viewed as the alternate to "re-roll and use either roll", and therefore imposes no restriction on other features re-rolling the die.

Settings API: Setting default option via ‘get_option’ fails

  1. All my options are stored in one array test_hs_options
  2. I have select list settings field ( test_hs_options['duration_months'] ) which stores the selected month (1-12).
  3. For this settings field, I would like to set a default option at 5.
  4. All my attempts at setting the default have failed.
  5. What am I missing?
// Callback for displaying sfield_select_duration. function cb_test_hs_sfield_select_duration() {      // get option test_hs_options['duration_months'] value from db.     // Set to '5' as default if option does not exist.     $  options  = get_option( 'test_hs_options', [ 'duration_months' => '5' ] );      $  duration = $  options['duration_months']; // fails!      var_dump($  options); // PHP Notice:  Undefined index: duration_months      // define the select option values for 'duration' select field.     $  months = array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12' );      // Display select control     echo '<select id="duration" name="test_hs_options[duration_months]">';         // loop through option values         foreach ( $  months as $  month ) {             // if saved option matches the option value, select it.             echo '<option value="' . $  month . '" ' . selected( $  duration, $  month, false ) . '>' . esc_html( $  month ) . '</option>';         }     echo '</select>'; }  

Does Improved Abjuration affects spells that only offer an option of having an ability check?

Consider the Abjuration Wizard’s 10th level feature:

Improved Abjuration

Beginning at 10th level, when you cast an abjuration spell that requires you to make an ability check as a part of casting that spell (as in Counterspell and Dispel Magic), you add your proficiency bonus to that ability check.

Some spells, such as Telekinesis, include cases where an ability check is required, either as soon as the spell is casted, or later one.

If the object is worn or carried by a creature, you must make an ability check with your spellcasting ability contested by that creature’s Strength check.

  1. Does an Abjuration Wizard ever adds his proficiency bonus when casting Telekinesis?
  2. If so, does that only apply to the case where a check is made on the same turn as the casting?

options.php does not save option value to database

seems it is duplicate question but i tried the existing solution and still not solved my problem. i creating the test plugin and i have problem in submitting value to options.php which is not store the value to corresponding option and still is null.

this is how i registered my option settings.

public function registerCustomFields(){          register_setting( 'opt_grp', 'last_name',array($  this->callBacks,'pluginOptionsGroup'));         add_settings_section( 'section_index', 'section title', array($  this->callBacks,'pluginSectionCB'), 'adm_menu' );         add_settings_field( 'last_name', 'test text', array( $  this->callBacks, 'pluginTextExample' ), 'adm_menu', 'section_index');     } add_action('admin_init',array($  this,'registerCustomFields')); 

and here is above callbacks

public function pluginOptionsGroup($  input){         return $  input;     }      public function pluginSectionCB(){         echo "Feachures Management";     }      public function pluginTextExample(){         $  value = get_option('last_name');                  echo '<input type="text" class="ui-toggle" id="last_name" name="last_name" value="'.$  value.'" >';     } 

and this is the form in myadmin.php page

<div>         <?php settings_errors(); ?>      <form type="POST" action="options.php">         <?php              settings_fields( 'opt_grp' );                          do_settings_sections( 'adm_menu' );                          submit_button();                          ?>               </form>  </div> 

i can find the option in option table but its always null,and when i change value in database itself its ok and by refreshing page it comes to textbox

Is the DMG’s Disarm option an entire action, or a replacement for a single weapon attack?

My confusion comes from the somewhat ambiguous wording of the Disarm action as described in the Dungeon Master’s Guide (p. 271):

A creature can use a weapon attack to knock a weapon or another item from a target’s grasp. The attacker makes an attack roll contested by the target’s Strength (Athletics) check or Dexterity (Acrobatics) check. If the attacker wins the contest, the attack causes no damage or other ill effect, but the defender drops the item.

Two things stand out to me:

A creature can use a weapon attack

One way to interpret this is to mean that this is replacing a normal weapon attack, disarming the target instead of dealing damage. The other way to interpret this is that this weapon attack is special; that despite being called an attack, it’s intended to be its own action type.

If the attacker wins the contest, the attack causes no damage or other ill effect

This also stands out to me. If this were its own action, and not a replacement for a regular attack, then it wouldn’t be necessary to specify that damage is negated; it would simply be presumed to deal no damage.

What is the correct way to interpret this action? Is it its own action, or a replacement for a single attack as part of the Attack action? If a character gets the Extra Attack feature, can Disarm replace every attack they’re otherwise allowed to make?