Created
February 6, 2017 04:21
-
-
Save akiya64/b72924ed0392061b4cb972b71f640dd2 to your computer and use it in GitHub Desktop.
Switch Excerpt
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
add_action ( 'edit_category_form_fields', 'extra_category_fields'); | |
function extra_category_fields( $tag ) { | |
$tid = $tag->term_id; | |
$is_show_excerpt = get_option( "cat_$tid_show_excerpt"); | |
?> | |
<tr class="form-field"> | |
<th><label for="extra_text">抜粋を表示</label></th> | |
<td> | |
<select name="is_show_exception" id="is_show_exception"> | |
<?php if($is_show_excerpt): ?> | |
<option value="true">はい</option> | |
<option value="false" selected>いいえ</option> | |
<?php else: ?> | |
<option value="true" selected>はい</option> | |
<option value="false">いいえ</option> | |
<?php endif: ?> | |
</select> | |
<p class="description">カテゴリーページの時、抜粋を表示します。</td> | |
</tr> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment