Last active
August 29, 2015 14:21
-
-
Save kurozumi/b4e1be9d648c078794aa to your computer and use it in GitHub Desktop.
【ワードプレス】「Bogo」プラグインで多言語化した固定ページのパーマリンクをスラッグから取得する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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