WordPress.org

Plugin Directory

Changeset 487552


Ignore:
Timestamp:
01/10/12 15:34:57 (6 years ago)
Author:
benbalter
Message:

move edit flow editorial metadat box below wpdr meta boxes by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-document-revisions/trunk/includes/admin.php

    r486882 r487552  
    6868        //we can still remove our hooks, just need to check if edit_flow is a class 
    6969        add_action( 'admin_init', array( &$this, 'edit_flow_admin_support' ), 20 ); 
     70        add_action( 'document_edit', array( &$this, 'edit_flow_metabox_sublimation' ) ); 
    7071             
    7172    } 
     
    10381039    /** 
    10391040     * Provides support for edit flow and disables the default workflow state taxonomy 
     1041     * @since 1.1 
    10401042     */ 
    10411043    function edit_flow_admin_support() { 
     
    10501052     
    10511053    } 
     1054     
     1055    /** 
     1056     * Sublimates the Editorial Metabox below the Document Metabox 
     1057     * 
     1058     * Because EditFlow's add_meta_box hook is before ours, and because both are in high,  
     1059     * by default, their metabox appears above the document metabox. This changes the default 
     1060     * position, but allows user to override via drag-drop. 
     1061     *  
     1062     * @since 1.2.2 
     1063     * @todo a better way to do this? 
     1064     */ 
     1065    function edit_flow_metabox_sublimation() { 
     1066     
     1067        if ( !class_exists( 'edit_flow' ) || !apply_filters( 'document_revisions_use_edit_flow', true ) ) 
     1068            return false; 
     1069     
     1070        global $wp_meta_boxes; 
     1071        if ( !isset( $wp_meta_boxes['document']['normal']['high']['edit-flow-editorial-comments'] ) ) 
     1072            return; 
     1073     
     1074        //force edit flow editorial comments to the bottom of the high stack 
     1075        $ef = $wp_meta_boxes['document']['normal']['high']['edit-flow-editorial-comments']; 
     1076        unset( $wp_meta_boxes['document']['normal']['high']['edit-flow-editorial-comments'] ); 
     1077        $wp_meta_boxes['document']['normal']['high']['edit-flow-editorial-comments'] = $ef; 
     1078         
     1079    } 
    10521080          
    10531081} 
Note: See TracChangeset for help on using the changeset viewer.