Skip to content

Commit

Permalink
Unload Markdown when bulk editing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwiebe committed Mar 12, 2014
1 parent 251eaff commit ef0a796
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/markdown/easy-markdown.php
@@ -1,4 +1,5 @@
<?php

/*
Plugin Name: Easy Markdown
Plugin URI: http://automattic.com/
Expand Down Expand Up @@ -67,11 +68,22 @@ public function load() {
add_action( 'switch_blog', array( $this, 'maybe_load_actions_and_filters' ), 10, 2 );
}
add_action( 'admin_init', array( $this, 'register_setting' ) );
add_action( 'admin_init', array( $this, 'maybe_unload_for_bulk_edit' ) );
if ( current_theme_supports( 'o2' ) || class_exists( 'P2' ) ) {
$this->add_o2_helpers();
}
}

/**
* If we're in a bulk edit session, unload so that we don't lose our markdown metadata
* @return null
*/
public function maybe_unload_for_bulk_edit() {
if ( isset( $_REQUEST['bulk_edit'] ) && $this->is_posting_enabled() ) {
$this->unload_markdown_for_posts();
}
}

/**
* Called on init and fires on switch_blog to decide if our actions and filters
* should be running.
Expand Down

0 comments on commit ef0a796

Please sign in to comment.