Skip to content

Instantly share code, notes, and snippets.

@nyankichi-n-n
Last active March 20, 2017 06:56
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 nyankichi-n-n/e43f7f99c0c166288b28959b86d9c554 to your computer and use it in GitHub Desktop.
Save nyankichi-n-n/e43f7f99c0c166288b28959b86d9c554 to your computer and use it in GitHub Desktop.
【デモ会員サイト】2 個人的な設定
<?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' );
// ****** ここまで、個人的な設定 ******
// ********************************
<?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