WordPress.org

Plugin Directory

Changeset 545677


Ignore:
Timestamp:
05/18/12 08:45:48 (2 years ago)
Author:
nbachiyski
Message:

Get rid of the vrev_ perfix since these are methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ice/trunk/ice.php

    r545676 r545677  
    2727 
    2828    function __construct() { 
    29         add_filter('mce_external_plugins', array( $this, 'vrev_load_plugins' ) ); 
    30         add_filter('wp_insert_post_data', array( $this, 'vrev_save_revisions_content' ), 1, 2); 
    31         add_filter('the_editor_content', array( $this, 'vrev_load_revisions_content' ) , 1 ); 
    32         add_action( 'wp_head', array( $this, 'vrev_add_preview_css' ) ); 
     29        add_filter('mce_external_plugins', array( $this, 'load_plugins' ) ); 
     30        add_filter('wp_insert_post_data', array( $this, 'save_revisions_content' ), 1, 2); 
     31        add_filter('the_editor_content', array( $this, 'load_revisions_content' ) , 1 ); 
     32        add_action( 'wp_head', array( $this, 'add_preview_css' ) ); 
    3333    } 
    3434 
    3535    // Add plugins to TinyMCE 
    36     function vrev_load_plugins($plugins) { 
     36    function load_plugins($plugins) { 
    3737        global $current_screen; 
    3838        // Only add to the default editor (for now?), supporting this in any editor would require more post-processing 
     
    4646 
    4747        // Add buttons to TinyMCE 
    48         add_filter('mce_buttons', array( $this, 'vrev_add_mce_buttons' ) ); 
    49         add_filter('mce_buttons_2', array( $this, 'vrev_add_mce_buttons_2' ) ); 
     48        add_filter('mce_buttons', array( $this, 'add_mce_buttons' ) ); 
     49        add_filter('mce_buttons_2', array( $this, 'add_mce_buttons_2' ) ); 
    5050 
    5151        // And to DFW 
    52         add_filter('wp_fullscreen_buttons', array( $this, 'vrev_fullscreen_button' ) ); 
     52        add_filter('wp_fullscreen_buttons', array( $this, 'fullscreen_button' ) ); 
    5353 
    5454        // Add Ice specific editor settings 
    55         add_filter('tiny_mce_before_init', array( $this, 'vrev_mce_settings' ), 10, 2); 
     55        add_filter('tiny_mce_before_init', array( $this, 'mce_settings' ), 10, 2); 
    5656 
    5757        // Output the JS in the footer 
    58         add_action('admin_print_footer_scripts', array( $this, 'vrev_add_js' ) ); 
     58        add_action('admin_print_footer_scripts', array( $this, 'add_js' ) ); 
    5959 
    6060        return $plugins; 
    6161    } 
    6262 
    63     function vrev_add_mce_buttons($buttons) { 
     63    function add_mce_buttons($buttons) { 
    6464        return array_merge( $buttons, array( 
    6565            '|', 
     
    7171    } 
    7272 
    73     function vrev_add_mce_buttons_2($buttons) { 
     73    function add_mce_buttons_2($buttons) { 
    7474        return array_merge( $buttons, array( 
    7575            '|', 
     
    7979    } 
    8080 
    81     function vrev_add_js() { 
     81    function add_js() { 
    8282        // Ice throws range errors when switching to fullscreen before the MCE instance is initialized. 
    8383        // This hides the "fullscreen" button in the HTML editor if it's loaded first. 
     
    9999 
    100100    // $settings is a PHP associative array containing all init strings: $settings['mce_setting_name'] = 'setting string'; 
    101     function vrev_mce_settings($settings, $editor_id) { 
     101    function mce_settings($settings, $editor_id) { 
    102102        global $current_user, $post; 
    103103 
     
    125125            'user' => array{ 'name' => 'Some Name', 'id' => rand() } 
    126126 
    127             ** See vrev_strip_spans() if changing these 
     127            ** See strip_spans() if changing these 
    128128        */ 
    129129        $ice_settings = array( 
     
    146146 
    147147    // save the content with revisions as meta 
    148     function vrev_save_revisions_content($data, $postarr) { 
     148    function save_revisions_content($data, $postarr) { 
    149149 
    150150        if ( empty($postarr['post_ID']) ) 
     
    156156 
    157157        // remove the change tracking spans 
    158         $data['post_content'] = $this->vrev_strip_spans($data['post_content']); 
     158        $data['post_content'] = $this->strip_spans($data['post_content']); 
    159159 
    160160        return $data; 
     
    162162 
    163163    // load the content with revisions when post is published 
    164     function vrev_load_revisions_content($content) { 
     164    function load_revisions_content($content) { 
    165165        global $post, $post_ID, $pagenow; 
    166166 
     
    175175 
    176176    // add styles to the change tracking when previewing a poas 
    177     function vrev_add_preview_css() { 
     177    function add_preview_css() { 
    178178        if ( is_preview() ) { 
    179179            ?> 
     
    200200 
    201201    // show "track changes" button in fullscreen mode 
    202     function vrev_fullscreen_button($buttons) { 
     202    function fullscreen_button($buttons) { 
    203203        if ( !user_can_richedit() ) 
    204204            return $buttons; 
     
    216216    // strip change tracking spans from PHP 
    217217    // expects slashed $content 
    218     function vrev_strip_spans($content) { 
     218    function strip_spans($content) { 
    219219        // short-circuit if no tracking spans 
    220220        if ( strpos($content, 'data-userid=') === false && strpos($content, 'ice-wp-') === false ) 
Note: See TracChangeset for help on using the changeset viewer.