Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active Aug 29, 2015
Embed
What would you like to do?
【ワードプレス】「Bogo」プラグインで多言語化した固定ページのパーマリンクをスラッグから取得する方法
if(!function_exists('get_permalink_by_slug')):
function get_permalink_by_slug($slug) {
global $locale;
$permalink = get_permalink(get_page_by_path($slug));
if(function_exists('bogo_get_url_with_lang'))
return bogo_get_url_with_lang($permalink, $locale);
return $permalink;
}
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment