Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions wp-markdown-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
exit;
}

if (!function_exists('jetpack_require_lib')) {
include_once dirname( __FILE__ ) . '/jetpack/require-lib.php';
}

if (!class_exists('WPCom_Markdown')) {
include_once dirname( __FILE__ ) . '/jetpack/markdown/easy-markdown.php';
}

define('PLUGIN_VERSION', '2.0');
define('MINIMUM_WP_VERSION', '3.1');

Expand All @@ -44,7 +36,7 @@ private function __construct()
add_filter('quicktags_settings', array($this, 'quicktags_settings'), $editorId = 'content');

// Load Jetpack Markdown module
$this->load_jetpack_markdown_module();
add_action( 'init', array( $this, 'load_jetpack_markdown_module' ) );
}

public static function getInstance()
Expand Down Expand Up @@ -75,6 +67,14 @@ function enqueue_stuffs()

function load_jetpack_markdown_module()
{
if ( ! function_exists( 'jetpack_require_lib' ) ) {
include_once dirname( __FILE__ ) . '/jetpack/require-lib.php';
}

if ( ! class_exists( 'WPCom_Markdown' ) ) {
include_once dirname( __FILE__ ) . '/jetpack/markdown/easy-markdown.php';
}

// If the module is active, let's make this active for posting, period.
// Comments will still be optional.
add_filter('pre_option_' . WPCom_Markdown::POST_OPTION, '__return_true');
Expand Down Expand Up @@ -188,4 +188,4 @@ function plugin_deactivation()

}

WpMarkdownEditor::getInstance();
WpMarkdownEditor::getInstance();