markdown.php
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Module Name: Markdown |
| 5 | * Module Description: Write posts or pages in plain-text Markdown syntax. |
| 6 | * Sort Order: 31 |
| 7 | * First Introduced: 2.8 |
| 8 | * Requires Connection: No |
| 9 | * Auto Activate: No |
| 10 | * Module Tags: Writing |
| 11 | */ |
| 12 | |
| 13 | include dirname( __FILE__ ) . '/markdown/easy-markdown.php'; |
| 14 | |
| 15 | // If the module is active, let's make this active for posting, period. |
| 16 | // Comments will still be optional. |
| 17 | add_filter( 'pre_option_' . WPCom_Markdown::POST_OPTION, '__return_true' ); |
| 18 | function jetpack_markdown_posting_always_on() { |
| 19 | // why oh why isn't there a remove_settings_field? |
| 20 | global $wp_settings_fields; |
| 21 | if ( isset( $wp_settings_fields['writing']['default'][ WPCom_Markdown::POST_OPTION ] ) ) { |
| 22 | unset( $wp_settings_fields['writing']['default'][ WPCom_Markdown::POST_OPTION ] ); |
| 23 | } |
| 24 | } |
| 25 | add_action( 'admin_init', 'jetpack_markdown_posting_always_on', 11 ); |