Last active
June 8, 2017 06:03
-
-
Save gatespace/41fbcd7eb2231ed6b5e6604687c48169 to your computer and use it in GitHub Desktop.
WordPress Bogo をカスタム投稿タイプでも使う ref: http://qiita.com/gatespace/items/75e70f5ae162c2962dcc
This file contains hidden or 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
<?php | |
/** | |
* Support custom post type with bogo. | |
* | |
* @param array $localizable Supported post types. | |
* @return array | |
*/ | |
function my_localizable_post_types( $localizable ) { | |
$localizable[] = 'custom_post_type_name'; | |
return $localizable; | |
} | |
add_filter( 'bogo_localizable_post_types', 'my_localizable_post_types', 10, 1 ); |
This file contains hidden or 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
<?php | |
/** | |
* Support custom post type with bogo. | |
* | |
* @param array $localizable Supported post types. | |
* @return array | |
*/ | |
function my_localizable_post_types( $localizable ) { | |
$args = array( | |
'public' => true, | |
'_builtin' => false | |
); | |
$custom_post_types = get_post_types( $args ); | |
return array_merge( $localizable, $custom_post_types ); | |
} | |
add_filter( 'bogo_localizable_post_types', 'my_localizable_post_types', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment