関数 wp_set_lang_dir()
2014/11/22
多言語対応の為のディレクトリセット 関数を定義
定義ファイル :/blog/wp-includes/load.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | function wp_set_lang_dir() { if ( !defined( 'WP_LANG_DIR' ) ) { if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || !@is_dir(ABSPATH . WPINC . '/languages') ) { /** * Server path of the language directory. * * No leading slash, no trailing slash, full path, not relative to ABSPATH * * @since 2.1.0 */ define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' ); if ( !defined( 'LANGDIR' ) ) { // Old static relative path maintained for limited backwards compatibility - won't work in some cases define( 'LANGDIR', 'wp-content/languages' ); } } else { /** * Server path of the language directory. * * No leading slash, no trailing slash, full path, not relative to `ABSPATH`. * * @since 2.1.0 */ define( 'WP_LANG_DIR', ABSPATH . WPINC . '/languages' ); if ( !defined( 'LANGDIR' ) ) { // Old relative path maintained for backwards compatibility define( 'LANGDIR', WPINC . '/languages' ); } } } } |