Disable title block on edit screen for a custom post type

I have a custom post type with a custom block to collect required data and store it in post meta data or standard fields like title or slug, so I don’t want to display the Title block. I can’t disable title support in the CPT, because too much else depends on it.

The only successful attempt so far has been using CSS to target the id "post-title-0" of the for the title and can clearly enqueue a small CSS file depending on the post type, but I don’t want to depend on something set by WordPress that I can’t control; it feels that something in Javascript would be a better way to go if possible. I was wondering if WP provde any hooks for this but haven’t found any.

I’m a javascript novice, having started learning it in the last few weeks in order to write some custom blocks, so am not clear on the extent of what can be acheived with it. (I have 50 years experience of programming, just not in JS).

It would be OK to only hide the title until the post has been saved.

Has anyone any ideas?

Gutenberg block previews suddenly not working

I have an issue with the Gutenberg block previews suddenly not showing at all when hovering over available blocks in the side panel. I have tried:

  • Commenting out custom code in the functions.php, including removing any enqueued JavaScript and CSS from the admin
  • Deactivating plugins (such as Advanced Custom Fields)

But the preview popup is still not showing. It worked initially, but right now it’s not working at all. I can’t see any errors in the JavaScript console or by enabling debug in the wp-config.php.

The expected behaviour would be for each block to show a preview and a description of the block that you’re hovering, but that popup is not showing as it is now. See this image for how it should look like:

enter image description here

I’ve tried searching for this on Google, but I can’t find anyone else having this problem. Has anyone here had this problem and knows what was causing it? Or is it a problem occurring because of a bug in WordPress itself?

Combination of Block and With – Unexpected results

I’m trying to use Block to prevent a function from executing. In this example, the function I’m trying to block will simply be Plus. My code has an inner With clause inside the Block. The With clause performs some operations itself, and also receives an expression passed-in as a function parameter. In the below example, I emulate that with an outer With clause.

Unexpectedly, for a simple two-operand Plus, Block is only blocking Plus for the expression passed-in to the inner With clause, not the Plus operation hard-coded into the With clause. For a three-operand Plus, it blocks everything.

A canonical code sample which produces this behavior is shown below. Any ideas? I may switch to using Inactivate for my real problem, though I have to think it through a bit more. Thanks!

With[{a := 1 + 2},  Block[   {Plus},   SetAttributes[{Plus}, HoldAllComplete];   With[{x := a + 3 + 4, y := a + 3 + (4 + 5)},    Hold[#] &@{x, Unevaluated@x, Hold[#] &@x, y, Unevaluated@y,       Hold[#] &@y}    ]]] 

Results:

Hold[7+(1+2)] Hold[Unevaluated[(1+2)+3+4]] Hold[Hold[7+(1+2)]] Hold[3+(1+2)+(4+5)] Hold[Unevaluated[(1+2)+3+(4+5)]] Hold[Hold[3+(1+2)+(4+5)]] 

Serialize custom block with InnerBlock

I have a custom gutenberg block with arbitrary InnerBlocks. For reasons of a custom javascript library I am using I cannot use the <InnerBlocks> component but want to iterate over all blocks and display the blocks with their InnerBlocks in my block’s edit function. I am using the code (simplified):

{ innerBlocks.map( ( block ) => {     return (         <div             key={ block.clientId }             dangerouslySetInnerHTML={ { __html: wp.blocks.getBlockContent( block ) } }         >         </div>     ); } ) } 

This works for most innerBlocks like core/heading, core/paragraph, … But for embeds e.g. it just displays the embed url but not the embedded media content, e.g. from Youtube. I found wp.blocks.serialize and wp.blocks.rawHandler but cannot get it to work either. What am I doing wrong. Can somebody who has deeper gutenberg knowledge point me to the right direction?

What does “+6 to hit, Hit: 13 (2d8 + 4)” mean in a creature’s stat block?

My friends and I are very new to D&D, played like 3 times. In a monster’s stats next to weapon damage it says stuff like “+11 to hit” and “Hit: 5 (1d8+1)”. For the premade characters it just says things like “+4, 2d6 + 2 slashing”, though. Why are there two “hit” numbers for monsters? Which do I use for the d20 roll to hit against a target’s AC?

I mean for example like in the Ogre entry in the “Starter Set: Excerpt 7” article on monsters.

Can multiple creatures completely block a ranged attack thus providing total cover?

I’m asking because while DMG p.251 states that 3 or 4 lines blocked by an obstacle gives 3/4 cover if the attack can still reach the target, it doesn’t state what happens if the attack can’t reach the target. I assume total cover but I might be wrong. And, as in the question, what if more than one creature each blocking 3 or 4 lines to a target. Would it create a 1/2 cover (as per Sage Advice Compendium), 3/4 cover, total cover or something else? also considering that only the best degree of cover is applied when more than one source of cover is there, if multiple creatures can ever create total cover.

I find all this to be confusing.

thanks for clarifying.