Mlp_Term_Translation::get_expected_base PHP Méthode

get_expected_base() private méthode

Find a custom taxonomy base
private get_expected_base ( string $taxonomy ) : boolean | string
$taxonomy string
Résultat boolean | string FALSE or the prepared string
    private function get_expected_base($taxonomy)
    {
        $taxonomies = ['category' => 'category_base', 'post_tag' => 'tag_base'];
        if (!isset($taxonomies[$taxonomy])) {
            return FALSE;
        }
        $option = get_option($taxonomies[$taxonomy]);
        if (!$option) {
            return FALSE;
        }
        return $option . '/%' . $taxonomy . '%';
    }