|
@@ 323-325 (lines=3) @@
|
| 320 |
|
* @return Block_Container |
| 321 |
|
*/ |
| 322 |
|
public function set_parent( $parent = null ) { |
| 323 |
|
if ( ! is_array( $parent ) && ! is_string( $parent ) && ! is_null( $parent ) ) { |
| 324 |
|
throw new \Exception( __( "The parent must be 'array', 'string' or 'null'.", 'crb' ) ); |
| 325 |
|
} |
| 326 |
|
|
| 327 |
|
$this->settings[ 'parent' ] = is_string( $parent ) ? array( $parent ) : $parent; |
| 328 |
|
|
|
@@ 370-372 (lines=3) @@
|
| 367 |
|
* @return Block_Container |
| 368 |
|
*/ |
| 369 |
|
public function set_inner_blocks_template( $template = null ) { |
| 370 |
|
if ( ! is_array( $template ) && ! is_null( $template ) ) { |
| 371 |
|
throw new \Exception( __( "The template must be an 'array' or 'null'.", 'crb' ) ); |
| 372 |
|
} |
| 373 |
|
|
| 374 |
|
$this->settings[ 'inner_blocks' ][ 'template' ] = $template; |
| 375 |
|
|
|
@@ 406-408 (lines=3) @@
|
| 403 |
|
* @return Block_Container |
| 404 |
|
*/ |
| 405 |
|
public function set_allowed_inner_blocks( $blocks = null ) { |
| 406 |
|
if ( ! is_array( $blocks ) && ! is_null( $blocks ) ) { |
| 407 |
|
throw new \Exception( __( "The allowed blocks must be an 'array' or 'null'.", 'crb' ) ); |
| 408 |
|
} |
| 409 |
|
|
| 410 |
|
if ( is_array( $blocks ) ) { |
| 411 |
|
$this->settings[ 'inner_blocks' ][ 'allowed_blocks' ] = array_map( function ( $block ) { |