| 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 |
* Additional Search Queries: md, markdown |
| 12 |
*/ |
| 13 |
|
| 14 |
include dirname( __FILE__ ) . '/markdown/easy-markdown.php'; |
| 15 |
|
| 16 |
// If the module is active, let's make this active for posting, period. |
| 17 |
// Comments will still be optional. |
| 18 |
add_filter( 'pre_option_' . WPCom_Markdown::POST_OPTION, '__return_true' ); |
| 19 |
function jetpack_markdown_posting_always_on() { |
| 20 |
// why oh why isn't there a remove_settings_field? |
| 21 |
global $wp_settings_fields; |
| 22 |
if ( isset( $wp_settings_fields['writing']['default'][ WPCom_Markdown::POST_OPTION ] ) ) { |
| 23 |
unset( $wp_settings_fields['writing']['default'][ WPCom_Markdown::POST_OPTION ] ); |
| 24 |
} |
| 25 |
} |
| 26 |
add_action( 'admin_init', 'jetpack_markdown_posting_always_on', 11 ); |
| 27 |
|