Changeset 946160
- Timestamp:
- 07/10/2014 11:21:05 AM (12 years ago)
- Location:
- third-column/trunk
- Files:
-
- 6 added
- 3 edited
-
admin.css (added)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (added)
-
scripts (added)
-
scripts/third-column.js (added)
-
styles (added)
-
styles/admin (added)
-
third-column.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
third-column/trunk/readme.txt
r452002 r946160 2 2 Contributors: marcus.downing 3 3 Tags: admin, edit 4 Requires at least: 3. 05 Tested up to: 3. 2.14 Requires at least: 3.8 5 Tested up to: 3.9.1 6 6 Stable tag: trunk 7 7 8 Adds a third column on the Edit Post / Edit Page admin page.8 Adds a third column on the Edit Post screen. 9 9 10 10 == Description == 11 11 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. 12 Add 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 14 Also adds a pair of mini columns underneath the edit boxes, giving you space for more small boxes. 15 16 17 == Installation == 18 19 1. Upload the `third-column` folder to the `/wp-content/plugins/` directory. 20 1. Activate the plugin through the 'Plugins' menu in WordPress 21 1. Edit any post 22 1. Drag boxes to the third column 23 24 25 == Screenshots == 26 27 1. The option to show three columns 28 29 2. An edit page with boxes in the third column and the mini columns 30 31 14 32 15 33 == Frequently Asked Questions == … … 23 41 The 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. 24 42 25 = = Installation ==43 = Why don't I see the third column? = 26 44 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 45 Open up the "Screen Options" panel in the top-right. Under the "Screen Layout" section, set the "Number of Columns" option to 3. 31 46 32 == Screenshots == 47 If that doesn't work, make sure you have Javascript turned on. 33 48 34 1. An edit page with boxes in the third column 49 = What happens when I switch the plugin off? = 50 51 The boxes should all jump back to the second column. 52 53 If 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 <?php1 <?php 2 2 /* 3 Plugin Name: Bang Admin:Third Column3 Plugin Name: Third Column 4 4 Plugin URI: http://www.bang-on.net/thirdcolumn.zip 5 5 Description: Adds a third column to the page and post edit form 6 6 Author: Marcus Downing 7 7 Author URI: http://www.bang-on.net 8 Version: 1.08 Version: 2.0 9 9 */ 10 10 … … 25 25 */ 26 26 27 28 if (!defined('BANG_THIRD_COLUMN_DEBUG')) 29 define('BANG_THIRD_COLUMN_DEBUG', false); 30 31 32 // Initialise 33 34 add_action('dbx_post_advanced', 'third_column_edit_form_init'); 35 function 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 48 function 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 27 59 /* Edit form */ 28 60 29 add_action('submitpost_box', 'third_column_edit_form'); 30 add_action('submitpage_box', 'third_column_edit_form'); 61 62 function third_column_edit_form_top($post) { 63 } 64 65 function third_column_edit_form_after_title($post) { 66 } 67 68 function 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 81 function 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'); 31 99 function third_column_edit_form() { 32 100 global $post; … … 57 125 </script><?php 58 126 } 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><?php135 }
Note: See TracChangeset
for help on using the changeset viewer.