/** * Create filterstring for msls_content_filter() * * @package Msls * @uses MslsOutput * @param string $pref * @param string $post * @return string */ function msls_filter_string($pref = '<p id="msls">', $post = '</p>') { $obj = new MslsOutput(); $links = $obj->get(1, true, true); $output = __('This post is also available in %s.', 'msls'); if (has_filter('msls_filter_string')) { /** * Overrides the string for the output of the translation hint * @since 1.0 * @param string $output * @param array $links */ $output = apply_filters('msls_filter_string', $output, $links); } else { if (count($links) > 1) { $last = array_pop($links); $output = sprintf($output, sprintf(__('%s and %s', 'msls'), implode(', ', $links), $last)); } elseif (1 == count($links)) { $output = sprintf($output, $links[0]); } else { $output = ''; } } return !empty($output) ? $pref . $output . $post : ''; }