Changeset 487221
- Timestamp:
- 01/09/2012 09:48:23 PM (14 years ago)
- Location:
- custom-fields/trunk
- Files:
-
- 4 edited
-
custom-fields.php (modified) (1 diff)
-
inc/class.admin.object.php (modified) (2 diffs)
-
inc/js/fields.js (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-fields/trunk/custom-fields.php
r401414 r487221 2 2 /* 3 3 Plugin Name: Custom Fields for WordPress 4 Version: 3.0. 14 Version: 3.0.2 5 5 Plugin URI: http://redmine.beapi.fr/projects/show/custom-fields 6 6 Description: This plugin add custom fields for some things on WordPress, blog, term taxonomy and custom object types. Meta for Taxonomies plugin is required to use custom fields with taxonomies. -
custom-fields/trunk/inc/class.admin.object.php
r401414 r487221 15 15 16 16 // Save custom datas 17 add_action( ' transition_post_status', array(&$this, 'saveCustomFields'), 10, 3 );17 add_action( 'wp_insert_post', array(&$this, 'saveCustomFields'), 10, 3 ); 18 18 19 19 // Add blocks on write page … … 85 85 * @author Julien Guilmont 86 86 */ 87 function saveCustomFields( $ new_status, $old_status, $post ) {87 function saveCustomFields( $post_id, $post ) { 88 88 $did_one = false; 89 if ( $post->post_type != $this->post_type || $new_status != 'publish' ||( isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') ) {89 if ( $post->post_type != $this->post_type || ( isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') ) { 90 90 return false; 91 91 } -
custom-fields/trunk/inc/js/fields.js
r401414 r487221 3 3 wpfields = { 4 4 init: function() { 5 var rem, sidebars = $('div.fields-sortables') ;5 var rem, sidebars = $('div.fields-sortables'), the_id; 6 6 7 7 $('a.edit-sidebar-link').click(function(){ … … 17 17 return false; 18 18 }); 19 /* 20 $('#fields-right').children('.fields-holder-wrap').children('.sidebar-name').click(function() { 21 var c = $(this).siblings('.fields-sortables'), 22 p = $(this).parent(); 23 if (!p.hasClass('closed')) { 24 c.sortable('disable'); 25 p.addClass('closed'); 26 } else { 27 p.removeClass('closed'); 28 c.sortable('enable').sortable('refresh'); 29 } 30 }); 31 */ 19 32 20 $('#fields-left').children('.fields-holder-wrap').children('.sidebar-name').children('.sidebar-name-arrow').click(function() { 33 21 var c = $(this).parent().siblings('.fields-sortables'), … … 46 34 return false; 47 35 }); 48 /* 49 $('#fields-left').children('.fields-holder-wrap').children('.sidebar-name').click(function() { 50 $(this).siblings('.field-holder').parent().toggleClass('closed'); 51 }); 52 */ 36 53 37 $('#fields-left').children('.fields-holder-wrap').children('.sidebar-name').children('.sidebar-name-arrow').click(function() { 54 38 $(this).parent().siblings('.field-holder').parent().toggleClass('closed'); … … 117 101 wpfields.fixWebkit(1); 118 102 ui.helper.find('div.field-description').hide(); 103 the_id = this.id; 119 104 }, 120 105 stop: function(e, ui) { … … 124 109 } 125 110 }); 126 /* 127 sidebars.children('.field').each( function(){ 128 $(this).live('mousedown', function(){ 129 console.log('toto'); 130 //$(this).sortable('refreshPositions'); 131 console.log($(this).children('.field').attr('class')); 132 $(this).children('.field').css('border', '5px solid red'); 133 }); 134 });*/ 111 135 112 sidebars.sortable({ 136 placeholder: 'field-placeholder',113 placeholder: 'field-placeholder', 137 114 items: '> .field', 138 115 handle: '> .field-top > .field-title', … … 159 136 var add = ui.item.find('input.add_new').val(), 160 137 n = ui.item.find('input.multi_number').val(), 161 id = ui.item.attr('id'),138 id = the_id, 162 139 sb = $(this).attr('id'); 163 140 164 141 ui.item.css({ 165 142 'marginLeft': '', … … 167 144 }); 168 145 wpfields.fixWebkit(); 169 //ui.item.css('width', '90%'); 146 the_id = ''; 147 170 148 if (add) { 171 149 if ('multi' == add) { … … 302 280 303 281 return false; 304 //this.resize();305 282 }, 306 283 -
custom-fields/trunk/readme.txt
r401414 r487221 3 3 Donate link: http://www.djudorange.fr/donate/ 4 4 Tags: custom, fields, custom fields, term meta, meta, post meta, object meta, editor 5 Requires at least: 3.0. 06 Tested up to: 3. 0.17 Stable tag: 2.2.25 Requires at least: 3.0.2 6 Tested up to: 3.3.1 7 Stable tag: 3.0.2 8 8 9 9 This plugin add custom fields for some things on WordPress, term taxonomy and custom object types … … 31 31 32 32 == Changelog == 33 * Version 3.0.2 34 * Fix JS compatible with new Sortable JQuery UI 33 35 * Version 3.0.1 : 34 36 * New Style of Admin page fields and in Post edit page
Note: See TracChangeset
for help on using the changeset viewer.