WordPress.org

Plugin Directory

Changeset 487889


Ignore:
Timestamp:
01/11/12 02:06:27 (2 years ago)
Author:
mattwiebe
Message:

Disable visual editor when editing Markdown

Location:
markdown-on-save-improved/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • markdown-on-save-improved/trunk/markdown-on-save.php

    r482884 r487889  
    33Plugin Name: Markdown on Save Improved 
    44Description: Allows you to compose content in Markdown on a per-item basis from WP admin or mobile/3rd-party apps. The markdown version is stored separately, so you can deactivate this plugin and your posts won't spew out Markdown. Based on <a href="http://wordpress.org/extend/plugins/markdown-osi/">Mark Jaquith's plugin</a>. 
    5 Version: 2.0 
     5Version: 2.0.1 
    66Author: Matt Wiebe 
    77Author URI: http://somadesign.ca/ 
     
    3434        add_filter( 'edit_post_content_filtered', array( $this, 'edit_post_content_filtered' ), 10, 2 ); 
    3535        add_action( 'xmlrpc_call', array($this, 'xmlrpc_actions') ); 
     36        add_action( 'load-post.php', array( $this, 'load' ) ); 
     37        add_action( 'load-post-new.php', array( $this, 'load') ); 
    3638    } 
    3739     
     
    7274        return $posts; 
    7375    } 
     76     
     77    public function load() { 
     78        if ( ! ( isset( $_GET['post'] ) && ! $this->is_markdown( $_GET['post'] ) ) ) { 
     79            add_filter( 'user_can_richedit', '__return_false', 99 ); 
     80        } 
     81    } 
    7482 
    7583    public function wp_insert_post_data( $data, $postarr ) { 
     
    8492        $id = ( isset( $postarr['ID']) ) ? $postarr['ID'] : 0; 
    8593         
    86         // Maybe do HTML Markdown 
     94        // Maybe do HTML → Markdown 
    8795        if ( $do_html_to_markdown )  
    8896            $data['post_content'] = $this->html_to_markdown($data['post_content']); 
  • markdown-on-save-improved/trunk/readme.txt

    r483154 r487889  
    44Requires at least: 3.2 
    55Tested up to: 3.3 
    6 Stable tag: 2.0 
     6Stable tag: 2.0.1 
    77 
    88Markdown + WordPress = writing bliss. The markdown version is stored separately, so you can deactivate this plugin and your posts won't spew out Markdown. 
     
    5858== Changelog == 
    5959 
     60= 2.0.1 = 
     61 
     62* Disable visual editor when editing Markdown 
     63 
    6064= 2.0 = 
    6165 
Note: See TracChangeset for help on using the changeset viewer.