Last active
March 20, 2017 06:56
-
-
Save nyankichi-n-n/e43f7f99c0c166288b28959b86d9c554 to your computer and use it in GitHub Desktop.
【デモ会員サイト】2 個人的な設定
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
<?php | |
// 一行目はシンタックスハイライトするために追加しています。 | |
// ******************************** | |
// ****** ここから、個人的な設定 ****** | |
// この部分は、サイト運用者で必要か判断 | |
// 自動保存の無効化 | |
function disable_autosave() { | |
wp_deregister_script('autosave'); | |
} | |
// コードの自動変換を停止(モブログツールを使う場合は必要だと思う) | |
add_filter( 'run_wptexturize', '__return_false' ); | |
//公開になっているカスタム投稿でMarkdownが使えるようにする | |
function my_custom_init() { | |
$args = array( | |
'public' => true, | |
'_builtin' => false | |
); | |
$output = 'names'; | |
$operator = 'and'; | |
$post_types = get_post_types( $args, $output, $operator ); | |
foreach ( $post_types as $post_type ) { | |
add_post_type_support( $post_type, 'wpcom-markdown' ); | |
} | |
} | |
add_action( 'init', 'my_custom_init' ); | |
// ****** ここまで、個人的な設定 ****** | |
// ******************************** |
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
<?php | |
// 一行目はシンタックスハイライトするために追加しています。 | |
//公開になっているカスタム投稿でパブリサイズ、Markdownが使えるようにする | |
function my_custom_init() { | |
$args = array( | |
'public' => true, | |
'_builtin' => false | |
); | |
$output = 'names'; | |
$operator = 'and'; | |
$post_types = get_post_types( $args, $output, $operator ); | |
foreach ( $post_types as $post_type ) { | |
add_post_type_support( $post_type, array( 'publicize', 'wpcom-markdown' ) ); | |
} | |
} | |
add_action( 'init', 'my_custom_init' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment