Plugin Directory

Changeset 778718


Ignore:
Timestamp:
09/26/2013 09:02:03 AM (12 years ago)
Author:
gilbitron
Message:

Fixes.

Location:
typewriter/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • typewriter/trunk/readme.txt

    r778705 r778718  
    3939<a href="http://whatismarkdown.com" target="_blank">whatismarkdown.com</a>
    4040
     41= Do I have to convert my HTML content? =
     42
     43No. You can still use normal HTML in your posts and pages. Markdown will simply ignore the HTML and only parse
     44any Markdown specific code that it finds.
     45
     46= What happens to my content if I deactivate the plugin? =
     47
     48Unfortunaetly your content will not be parsed by MarkdownExtra anymore and will appear like it does in the text
     49editor. In this case you would need to convert your Markdown content to normal HTML.
     50
    4151== Screenshots ==
    4252
  • typewriter/trunk/typewriter.php

    r778705 r778718  
    1919        $this->plugin_path = plugin_dir_path( __FILE__ );
    2020        $this->plugin_url = plugin_dir_url( __FILE__ );
     21        register_activation_hook( __FILE__, array(&$this, 'activate') );
    2122       
    2223        add_action( 'plugins_loaded', array(&$this, 'init') );
     
    3738    }
    3839   
     40    function activate( $network_wide ) {
     41        $this->disable_rich_editing();
     42    }
     43   
    3944    function init() {
    4045        load_plugin_textdomain( 'dev7-typewriter', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
     
    4247   
    4348    function disable_rich_editing() {
    44         update_user_option( get_current_user_id(), 'rich_editing', 'false', true );
     49        //update_user_option( get_current_user_id(), 'rich_editing', 'false', true );
     50        global $wpdb;
     51        $wpdb->query( "UPDATE `" . $wpdb->prefix . "usermeta` SET `meta_value` = 'false' WHERE `meta_key` = 'rich_editing'" );
    4552    }
    4653   
     
    8895        if( !class_exists( 'Michelf\MarkdownExtra' ) ){
    8996            spl_autoload_register(function( $class ){
    90                 require_once $this->plugin_path .'includes/markdown/'. preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
     97                require_once plugin_dir_path( __FILE__ ) .'/includes/markdown/'. preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
    9198            });
    9299        }
Note: See TracChangeset for help on using the changeset viewer.