Add new Administration menu item in WordPress

although I have some skills in WP development, I do not know how to create new (page and post-like) Administration menu. I can see them in purchased themes only.

I want to create the new item here:

enter image description here

On click on such item, I would like to see page-like table, possibility to add new items (possibly save such items in the new db table) and use this data elsewhere. I cannot past any code because I don’t even know how to Google this. Can somebody tell me where start?

How to add the item price in the review order section of the checkout page

I have this code that adds an items "each" price in the review order section of the checkout page, which is what i want.

However, it also adds it to the cart page, which i do not want.

How can i update this code to make sure the individual price does not show on the cart page?

<?php 

add_filter( ‘woocommerce_cart_item_name’, ‘showing_price_in_cart_items’, 99, 3 ); function showing_price_in_cart_items( $ item_name, $ cart_item, $ cart_item_key ) { // The WC_Product object $ product = $ cart_item[‘data’];

if (empty($  product)) {     return $  item_name; }  // Get the  price $  price = $  product->get_price();  // When price doesn't exist if (empty($  price)) {     return $  item_name; }  // display the price $  item_name .= '<br><small class="product-price">' . __( "£$  price each: ", "woocommerce") . $  price . '</small>';  return $  item_name; 

}

Does a magic item giving +3 to spell save DC break bounded accuracy?

In Tasha’s Cauldron of Everything p.134, there is a magic item: Rhythm Maker’s Drum. It gives bonus to spell attack rolls and spell saving throw DCs of the user depending on rarity: uncommon +1, rare +2, very rare +3.

Even though the same +X for a magic weapon is normal, and some weapons have specfic extra effects, it seems a dodgy for spells, because that is +X for every spell attack roll, with all their different extra effects covered. But then +3 save DC for "save or suck" spell effects, like 1st level Ray of Sickness or 4th level Polymorph, just seems way out there at any character level.

Question: Am I overreacting, is there something I am not seeing? Or is this drum, and any similar item, just something which a balance-concerned DM should not allow anywhere near their table, or maybe limit it to +1 version and making that very rare or something?


Reminder: I’m not asking for opinions. An answer like "it’s fine" or "it’s broken" must be backed up by facts (other items, rules quotes, sage advice…).

Add a counter beside menu item label

I’m using the following code to add a panel to the admin menu screen, so the users are able to add a Cart link to their menus:

function my_add_meta_box() {     add_meta_box( 'custom-meta-box', __( 'Cart' ), 'my_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); } add_action( 'admin_init', 'my_add_meta_box' );  function my_nav_menu_item_link_meta_box() {     global $  _nav_menu_placeholder, $  nav_menu_selected_id;     $  _nav_menu_placeholder = 0 > $  _nav_menu_placeholder ? $  _nav_menu_placeholder - 1 : -1;     ?>     <div id="posttype-cart" class="posttypediv">         <div id="tabs-panel-cart" class="tabs-panel tabs-panel-active">             <ul id="cart-checklist" class="categorychecklist form-no-clear">                 <li>                     <label class="menu-item-title">                         <input type="checkbox" class="menu-item-checkbox" name="menu-item[<?php echo (int) $  _nav_menu_placeholder; ?>][menu-item-object-id]" value="-1"> <?php esc_html_e( 'Cart' ); ?>                     </label>                     <input type="hidden" class="menu-item-type" name="menu-item[<?php echo (int) $  _nav_menu_placeholder; ?>][menu-item-type]" value="post_type">                     <input type="hidden" class="menu-item-object" name="menu-item[<?php echo (int) $  _nav_menu_placeholder; ?>][menu-item-object]" value="page">                     <input type="hidden" class="menu-item-object-id" name="menu-item[<?php echo (int) $  _nav_menu_placeholder; ?>][menu-item-object-id]" value="<?php echo get_option( 'cart_page_id' ); ?>">                     <input type="hidden" class="menu-item-title" name="menu-item[<?php echo (int) $  _nav_menu_placeholder; ?>][menu-item-title]" value="<?php esc_html_e( 'Cart' ); ?>">                 </li>             </ul>         </div>         <p class="button-controls">             <span class="add-to-menu">                 <input type="submit" <?php disabled( $  nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-post-type-menu-item" id="submit-posttype-cart">                 <span class="spinner"></span>             </span>         </p>     </div>     <?php } 

My question is, is it possible to dynamically add a counter that shows the number of items in cart beside the Cart menu item label in the frontend? If so, how? I think that the wp_get_nav_menu_items filter might be useful for this, but how can I identify the Cart menu item in there to be able to modify its label in the frontend on the fly?

function my_get_nav_menu_items( $  items ) {     foreach ( $  items as $  item ) {         if ( is_cart_menu_item( $  item ) ) {             // add a counter beside the Cart menu item label             }     }     return items; } add_filter( 'wp_get_nav_menu_items', 'my_get_nav_menu_items', 20 ); 

5e: Artificer: Does infused magic item count against maximum number of infusions?

I would assume the answer is ‘no’ but I wanted to check.

It feels very odd to be able to replicate (up to) 4 magic items at level 2, but only ever be able to use two of them at a time at that level, because it just saves you a bit of money early on, Or, for example, if you replicate a bag of holding, you can only ever have one other infusion active.

I have seen a few people claim that the replicate magic item infusion does not count against the standard 2 max infusions (at level 2). Just that you are limited to having only 1 replica of your chosen magic item at any one time. The claim is that (TCOE p12) the reference to an ‘infusion ending on a bag of holding’ is only applied if you attempt to make a new bag of holding, but I wanted to ask what other’s thought

I like this second option better, as it means you can play more with your enhancement infusions and so that if you ever want to change your other infusions, you don’t have to constantly pick up every item that pops out of your bag of holding (since it would be the oldest infusion every other time, you would have to re-create the infusion and put everything back into the bag)

Replace or Update a Table Row – based on the presence of a matching row item

Unfortunately I know next to nothing about php coding that contains some sql code. The examples I have seen online do not seem to match the same syntax that I inherited with this code, which is making this task confusing for me.

I have a database table called "effort" that contains two columns:

Column 1 = ad  Column 2 = theEffort 


 This line of code below works, and it will populate the table with the proper values for both the "ad" and "theEffort" 

$  sql = "INSERT INTO effort SET ad='$  ad', theEffort='$  theEffort'"; 


 But I do not want the table to grow over time and contain redundant rows pertaining to the same ad. Each "ad" in this table should be unique. But each "ad" could have 5 different effort values, e.g., "theEffort" can be "easy", "medium", "difficult", "impossible".

The "ad" is 13 digit number, i.e. SFAD_000001234

Does anybody know how to modify my code above using similar syntax so that it would first check to see if the "ad" exists in the database table called "effort". And if so, instead of entering a new row it would update "theEffort" to the new value. And if the "ad" did not exist in any table row within the "effort" database then it would execute the INSERT INTO function, i.e., insert both the "ad" and "theEffort" as a new table row.

Thank you in advance, -Jeff