Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/b4e1be9d648c078794aa to your computer and use it in GitHub Desktop.
Save kurozumi/b4e1be9d648c078794aa to your computer and use it in GitHub Desktop.
【ワードプレス】「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