27 lines
573 B
PHP
27 lines
573 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/* SECTIONS HELPERS */
|
||
|
|
if( !function_exists( 'section_must_be' ) ){
|
||
|
|
|
||
|
|
function section_must_be( array|string $sections, string $item ): bool
|
||
|
|
{
|
||
|
|
if( is_array($sections) ){
|
||
|
|
return in_array( $item, $sections );
|
||
|
|
}
|
||
|
|
return $sections === $item;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
if( !function_exists( 'section_must_not_be' ) ){
|
||
|
|
|
||
|
|
function section_must_not_be( array|string $sections, string $item ): bool
|
||
|
|
{
|
||
|
|
if( is_array($sections) ){
|
||
|
|
return ! in_array( $item, $sections );
|
||
|
|
}
|
||
|
|
return $sections !== $item;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|