Example #1
0
function yoast_og_categorized()
{
    if (function_exists('\\Ubik\\is_categorized') && \Ubik\is_categorized() === false) {
        add_filter('wpseo_og_article_section', '__return_empty_string');
    }
}
Example #2
0
                    $content = $term->name;
                }
                $content = sprintf('<span class="p-category"><a href="%s" rel="tag">%s</a></span>', get_term_link($term, $taxonomy), $content);
            }
            // Return whatever we have (which might only be the original contents of the shortcode when there is no term matched)
            return apply_filters('ubik_taxonomy_shortcode', apply_filters('ubik_{$taxonomy}_shortcode', $content));
        });
    }
}
// == VARIOUS == //
// Allow user configuration to override the categorization check
if ($options['categorized'] === false) {
    add_filter('ubik_categorized', '__return_false');
}
// Automatically hide categories filter on single category blogs
if (is_admin() && \Ubik\is_categorized() === false) {
    add_action('admin_head-edit.php', function () {
        echo \Ubik\get_wrap('css', 'select#cat { display: none; }');
    });
}
// Allow shortcodes in term descriptions; be forewarned that you can trigger an infinite loop by filtering additional term-related stuff this way
if ($options['description_shortcodes']) {
    add_filter('term_description', 'shortcode_unautop');
    add_filter('term_description', 'do_shortcode');
}
// A simple helper function that allows for mass filtering of term names and descriptions exclusively on the front-end
// This was developed for use with Markdown transformations and CJK character wrapping but you can use it for whatever
// @filter: ubik_terms_display_name
// @filter: ubik_terms_display_description
function display_terms_filter($term)
{