|
@@ 351-359 (lines=9) @@
|
| 348 |
|
* @param string $position |
| 349 |
|
* @return Block_Container |
| 350 |
|
*/ |
| 351 |
|
public function set_inner_blocks_position( $position = 'above' ) { |
| 352 |
|
if ( ! in_array( $position, [ 'above', 'below' ] ) ) { |
| 353 |
|
throw new \Exception( __( "The position of inner blocks must be 'above' or 'below'.", 'crb' ) ); |
| 354 |
|
} |
| 355 |
|
|
| 356 |
|
$this->settings[ 'inner_blocks' ][ 'position' ] = $position; |
| 357 |
|
|
| 358 |
|
return $this; |
| 359 |
|
} |
| 360 |
|
|
| 361 |
|
/** |
| 362 |
|
* Set the default template that should be rendered in inner blocks. |
|
@@ 387-395 (lines=9) @@
|
| 384 |
|
* @param string|boolean|null $lock |
| 385 |
|
* @return Block_Container |
| 386 |
|
*/ |
| 387 |
|
public function set_inner_blocks_template_lock( $lock = null ) { |
| 388 |
|
if ( is_string( $lock ) && ! in_array( $lock, [ 'all', 'insert' ] ) ) { |
| 389 |
|
throw new \Exception( __( "The template lock must be 'all', 'insert', 'false' or 'null'.", 'crb' ) ); |
| 390 |
|
} |
| 391 |
|
|
| 392 |
|
$this->settings[ 'inner_blocks' ][ 'template_lock' ] = $lock; |
| 393 |
|
|
| 394 |
|
return $this; |
| 395 |
|
} |
| 396 |
|
|
| 397 |
|
/** |
| 398 |
|
* Set the list of allowed blocks that can be inserted. |