'', 'before_title' => '', 'after_title' => '', 'after_widget' => '' )); } function art_normalize_widget_style_tokens($content) { $bw = ''; $bwt = ''; $ewt = ''; $bwc = ''; $ewc = ''; $ew = ''; $result = ''; $startBlock = 0; $endBlock = 0; while (true) { $startBlock = strpos($content, $bw, $endBlock); if (false === $startBlock) { $result .= substr($content, $endBlock); break; } $result .= substr($content, $endBlock, $startBlock - $endBlock); $endBlock = strpos($content, $ew, $startBlock); if (false === $endBlock) { $result .= substr($content, $endBlock); break; } $endBlock += strlen($ew); $widgetContent = substr($content, $startBlock, $endBlock - $startBlock); if ((false == strpos($widgetContent, $bwt)) xor (false == strpos($widgetContent, $ewt))) { $widgetContent = str_replace($bwt, '', $widgetContent); $widgetContent = str_replace($ewt, '', $widgetContent); } if (false === strpos($widgetContent, $bwt)) { $widgetContent = str_replace($bw, $bw . $bwc, $widgetContent); } else { $widgetContent = str_replace($ewt, $ewt . $bwc, $widgetContent); } $result .= str_replace($ew, $ewc . $ew, $widgetContent); } return $result; } function art_sidebar($index = 1) { if (!function_exists('dynamic_sidebar')) return false; ob_start(); $success = dynamic_sidebar($index); $content = ob_get_clean(); if (!$success) return false; $content = art_normalize_widget_style_tokens($content); $replaces = array( '' => "
\n
", '' => "
\n", '' => "\n
\n
\n
\n", '' => "
\n
", '' => "
\n
\n", '' => "
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n" ); $content = str_replace(array_keys($replaces), array_values($replaces), $content); echo $content; return true; } function art_list_pages_filter($output) { return preg_replace('~]*)>]*)>([^<]*)~', '$3', $output); } add_action('wp_list_pages', 'art_list_pages_filter');