Plugin Directory

Changeset 946160


Ignore:
Timestamp:
07/10/2014 11:21:05 AM (12 years ago)
Author:
marcus.downing
Message:

Version 2.0

Location:
third-column/trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • third-column/trunk/readme.txt

    r452002 r946160  
    22Contributors: marcus.downing
    33Tags: admin, edit
    4 Requires at least: 3.0
    5 Tested up to: 3.2.1
     4Requires at least: 3.8
     5Tested up to: 3.9.1
    66Stable tag: trunk
    77
    8 Adds a third column on the Edit Post / Edit Page admin page.
     8Adds a third column on the Edit Post screen.
    99
    1010== Description ==
    1111
    12 Adds a third column on the Edit Post and Edit Page pages (and the edit page for custom post types).
    13 This is useful if you have a lot of boxes on your edit screen, from custom taxonomies and plugins.
     12Add the option for a third column on the Edit Post and Edit Page screens. This is useful if you have a lot of boxes on your edit screen, from custom taxonomies and plugins.
     13
     14Also adds a pair of mini columns underneath the edit boxes, giving you space for more small boxes.
     15
     16
     17== Installation ==
     18
     191. Upload the `third-column` folder to the `/wp-content/plugins/` directory.
     201. Activate the plugin through the 'Plugins' menu in WordPress
     211. Edit any post
     221. Drag boxes to the third column
     23
     24
     25== Screenshots ==
     26
     271. The option to show three columns
     28
     292. An edit page with boxes in the third column and the mini columns
     30
     31
    1432
    1533== Frequently Asked Questions ==
     
    2341The layout of boxes is specific to the post type, so you can have one layout for Posts, one for Pages, and one for each custom post type.
    2442
    25 == Installation ==
     43= Why don't I see the third column? =
    2644
    27 1. Upload the `third-column` folder to the `/wp-content/plugins/` directory.
    28 1. Activate the plugin through the 'Plugins' menu in WordPress
    29 1. Edit any post
    30 1. Drag boxes to the third column
     45Open up the "Screen Options" panel in the top-right. Under the "Screen Layout" section, set the "Number of Columns" option to 3.
    3146
    32 == Screenshots ==
     47If that doesn't work, make sure you have Javascript turned on.
    3348
    34 1. An edit page with boxes in the third column
     49= What happens when I switch the plugin off? =
     50
     51The boxes should all jump back to the second column.
     52
     53If it doesn't work - if your boxes disappear - try turning the plugin on again, then back off.
     54
     55
     56== Changelog ==
     57
     58= 2.0 =
     59* Major update to work on new versions of Wordpress (3.8+)
     60* Added "mini columns" under the main editor
     61
     62= 1.0 =
     63* First release
  • third-column/trunk/third-column.php

    r452002 r946160  
    1 <?php
     1  <?php
    22/*
    3 Plugin Name: Bang Admin: Third Column
     3Plugin Name: Third Column
    44Plugin URI: http://www.bang-on.net/thirdcolumn.zip
    55Description: Adds a third column to the page and post edit form
    66Author: Marcus Downing
    77Author URI: http://www.bang-on.net
    8 Version: 1.0
     8Version: 2.0
    99*/
    1010
     
    2525*/
    2626
     27
     28if (!defined('BANG_THIRD_COLUMN_DEBUG'))
     29  define('BANG_THIRD_COLUMN_DEBUG', false);
     30
     31
     32//  Initialise
     33
     34add_action('dbx_post_advanced', 'third_column_edit_form_init');
     35function third_column_edit_form_init() {
     36  if (BANG_THIRD_COLUMN_DEBUG) do_action('log', 'Third column: Initialise edit form');
     37
     38  // the JS and CSS
     39  add_action('admin_enqueue_scripts', 'third_column_enqueue_scripts');
     40
     41  // the actual sidebar writers
     42  add_action('edit_form_top', 'third_column_edit_form_top', 10, 1);
     43  add_action('edit_form_after_title', 'third_column_edit_form_after_title', 10, 1);
     44  add_action('edit_form_after_editor', 'third_column_edit_form_after_editor', 10, 1);
     45  add_action('dbx_post_sidebar', 'third_column_dbx_post_sidebar', 10, 1);
     46}
     47
     48function third_column_enqueue_scripts () {
     49  //  change the screen options
     50  add_screen_option('layout_columns', array('max' => 3, 'default' => 3) );
     51   add_screen_option('mini_columns', array('max' => 3, 'default' => 3, 'label' => 'Mini columns') );
     52
     53  // add scripts and styles
     54  wp_enqueue_style('third-column', plugins_url('admin.css', __FILE__));
     55  wp_enqueue_script('third-column', plugins_url('scripts/third-column.js', __FILE__));
     56}
     57
     58
    2759/* Edit form */
    2860
    29 add_action('submitpost_box', 'third_column_edit_form');
    30 add_action('submitpage_box', 'third_column_edit_form');
     61
     62function third_column_edit_form_top($post) {
     63}
     64
     65function third_column_edit_form_after_title($post) {
     66}
     67
     68function third_column_edit_form_after_editor($post) {
     69  ?>
     70  <div id='postbox-subcols'>
     71    <div id="postbox-container-left" class="postbox-container">
     72      <?php do_meta_boxes(null, 'left', $post); ?>
     73    </div>
     74    <div id="postbox-container-right" class="postbox-container">
     75      <?php do_meta_boxes(null, 'right', $post); ?>
     76    </div>
     77  </div>
     78  <?php
     79}
     80
     81function third_column_dbx_post_sidebar($post) {
     82  $post_type = $post->post_type;
     83
     84  ?><div id="postbox-container-3" class="postbox-container"><?php
     85    do_meta_boxes($post_type, 'column3', $post);
     86  ?></div><?php
     87}
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97// add_action('submitpost_box', 'third_column_edit_form');
     98// add_action('submitpage_box', 'third_column_edit_form');
    3199function third_column_edit_form() {
    32100  global $post;
     
    57125  </script><?php
    58126}
    59 
    60 /* Options */
    61 
    62 //add_action('admin_menu', 'third_column_create_menu');
    63 function third_column_create_menu () {
    64   add_menu_page('Third Column', 'Third Column', 'administrator', __FILE__, 'third_column_settings',plugins_url('/images/icon.png', __FILE__));
    65   add_action('admin_init', 'third_column_register_settings');
    66 }
    67 
    68 function third_column_register_settings () {
    69   register_setting('third-column', 'cols-post');
    70   register_setting('third-column', 'cols-page');
    71 }
    72 
    73 function third_column_settings () {
    74  
    75 }
    76 
    77 
    78 function default_options () {
    79   return array(
    80     //
    81   );
    82 }
    83 
    84 
    85 
    86 /* CSS */
    87 
    88 add_action('admin_print_styles', 'third_column_css');
    89 function third_column_css () {
    90   ?><style>
    91 #post #side-info-column {
    92   width: 580px;
    93 }
    94 
    95 #post #post-body {
    96   margin-right: -620px !important;
    97 }
    98 
    99 #post #post-body-content {
    100   margin-right: 600px !important;
    101 }
    102 
    103 #post #column3-sortables {
    104   width: 280px;
    105   float: right;
    106   display: block;
    107   min-height: 200px;
    108 }
    109 
    110 #post #side-sortables {
    111   float: left;
    112   display: block;
    113   min-height: 200px;
    114 }
    115 
    116 /* Style copied from #side-sortables */
    117 
    118 #post #column3-sortables .category-tabs, #column3-sortables .category-tabs {
    119   margin-bottom: 3px;
    120 }
    121 
    122 #post #column3-sortables .category-tabs li, #column3-sortables .add-menu-item-tabs li {
    123   display: inline;
    124 }
    125 
    126 #post #column3-sortables .category-tabs a, #column3-sortables .add-menu-item-tabs a {
    127   text-decoration: none;
    128 }
    129 
    130 #post #column3-sortables .category-tabs .tabs a, #column3-sortables .add-menu-item-tabs .tabs a {
    131   color: #333;
    132 }
    133 
    134   </style><?php
    135 }
Note: See TracChangeset for help on using the changeset viewer.