Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
get_registered_theme_features example
if
(
rest_is_field_included
(
"{
$field
}
.rendered",
$fields
)
)
{
$data
[
$field
]
[
'rendered'
]
=
$theme
->
display
(
$header
)
;
}
}
$current_theme
=
wp_get_theme
(
)
;
if
(
rest_is_field_included
(
'status',
$fields
)
)
{
$data
[
'status'
]
=
(
$this
->
is_same_theme
(
$theme
,
$current_theme
)
)
? 'active' : 'inactive';
}
if
(
rest_is_field_included
(
'theme_supports',
$fields
)
&&
$this
->
is_same_theme
(
$theme
,
$current_theme
)
)
{
foreach
(
get_registered_theme_features
(
)
as
$feature
=>
$config
)
{
if
(
!
is_array
(
$config
[
'show_in_rest'
]
)
)
{
continue
;
}
$name
=
$config
[
'show_in_rest'
]
[
'name'
]
;
if
(
!
rest_is_field_included
(
"theme_supports.{
$name
}
",
$fields
)
)
{
continue
;
}
if
(
!
current_theme_supports
(
$feature
)
)
{