Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
get_comment_feed_permastruct example
function
get_feed_link
(
$feed
= ''
)
{
global
$wp_rewrite
;
$permalink
=
$wp_rewrite
->
get_feed_permastruct
(
)
;
if
(
$permalink
)
{
if
(
str_contains
(
$feed
, 'comments_'
)
)
{
$feed
=
str_replace
(
'comments_', '',
$feed
)
;
$permalink
=
$wp_rewrite
->
get_comment_feed_permastruct
(
)
;
}
if
(
get_default_feed
(
)
==
$feed
)
{
$feed
= '';
}
$permalink
=
str_replace
(
'%feed%',
$feed
,
$permalink
)
;
$permalink
=
preg_replace
(
'#/+#', '/', "/
$permalink
"
)
;
$output
=
home_url
(
user_trailingslashit
(
$permalink
, 'feed'
)
)
;
}
else
{
if
(
empty
(
$feed
)
)
{