@@ 269-277 (lines=9) @@ | ||
266 | * @param string $position |
|
267 | * @return Block_Container |
|
268 | */ |
|
269 | public function set_inner_blocks_position( $position = 'above' ) { |
|
270 | if ( ! in_array( $position, [ 'above', 'below' ] ) ) { |
|
271 | throw new \Exception( __( "The position of inner blocks must be 'above' or 'below'.", 'crb' ) ); |
|
272 | } |
|
273 | ||
274 | $this->settings[ 'inner_blocks' ][ 'position' ] = $position; |
|
275 | ||
276 | return $this; |
|
277 | } |
|
278 | ||
279 | /** |
|
280 | * Set the default template that should be rendered in inner blocks. |
|
@@ 305-313 (lines=9) @@ | ||
302 | * @param string|boolean|null $lock |
|
303 | * @return Block_Container |
|
304 | */ |
|
305 | public function set_inner_blocks_template_lock( $lock = null ) { |
|
306 | if ( is_string( $lock ) && ! in_array( $lock, [ 'all', 'insert' ] ) ) { |
|
307 | throw new \Exception( __( "The template lock must be 'all', 'insert', 'false' or 'null'.", 'crb' ) ); |
|
308 | } |
|
309 | ||
310 | $this->settings[ 'inner_blocks' ][ 'template_lock' ] = $lock; |
|
311 | ||
312 | return $this; |
|
313 | } |
|
314 | ||
315 | /** |
|
316 | * Set the list of allowed blocks that can be inserted. |