Plugin Directory

Changeset 487221


Ignore:
Timestamp:
01/09/2012 09:48:23 PM (14 years ago)
Author:
djudorange
Message:

fix JS with new JQuery in 3.3.1

Location:
custom-fields/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • custom-fields/trunk/custom-fields.php

    r401414 r487221  
    22/*
    33Plugin Name: Custom Fields for WordPress
    4 Version: 3.0.1
     4Version: 3.0.2
    55Plugin URI: http://redmine.beapi.fr/projects/show/custom-fields
    66Description: 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  
    1515       
    1616        // 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 );
    1818       
    1919        // Add blocks on write page
     
    8585     * @author Julien Guilmont
    8686     */
    87     function saveCustomFields( $new_status, $old_status, $post )  {
     87    function saveCustomFields( $post_id, $post )  {
    8888                $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') ) {
    9090            return false;
    9191        }
  • custom-fields/trunk/inc/js/fields.js

    r401414 r487221  
    33    wpfields = {
    44        init: function() {
    5             var rem, sidebars = $('div.fields-sortables');
     5            var rem, sidebars = $('div.fields-sortables'), the_id;
    66
    77                        $('a.edit-sidebar-link').click(function(){
     
    1717                return false;
    1818            });
    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           
    3220            $('#fields-left').children('.fields-holder-wrap').children('.sidebar-name').children('.sidebar-name-arrow').click(function() {
    3321                var c = $(this).parent().siblings('.fields-sortables'),
     
    4634                return false;
    4735            });
    48                         /*
    49                         $('#fields-left').children('.fields-holder-wrap').children('.sidebar-name').click(function() {
    50                 $(this).siblings('.field-holder').parent().toggleClass('closed');
    51             });
    52                         */
     36           
    5337            $('#fields-left').children('.fields-holder-wrap').children('.sidebar-name').children('.sidebar-name-arrow').click(function() {
    5438                $(this).parent().siblings('.field-holder').parent().toggleClass('closed');
     
    117101                    wpfields.fixWebkit(1);
    118102                    ui.helper.find('div.field-description').hide();
     103                    the_id = this.id;
    119104                },
    120105                stop: function(e, ui) {
     
    124109                }
    125110            });
    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           
    135112            sidebars.sortable({
    136                                 placeholder: 'field-placeholder',
     113                placeholder: 'field-placeholder',
    137114                items: '> .field',
    138115                handle: '> .field-top > .field-title',
     
    159136                    var add = ui.item.find('input.add_new').val(),
    160137                        n = ui.item.find('input.multi_number').val(),
    161                         id = ui.item.attr('id'),
     138                        id = the_id,
    162139                        sb = $(this).attr('id');
    163 
     140                       
    164141                    ui.item.css({
    165142                        'marginLeft': '',
     
    167144                    });
    168145                    wpfields.fixWebkit();
    169                                         //ui.item.css('width', '90%');
     146                    the_id = '';
     147                   
    170148                    if (add) {
    171149                        if ('multi' == add) {
     
    302280
    303281            return false;
    304             //this.resize();
    305282        },
    306283
  • custom-fields/trunk/readme.txt

    r401414 r487221  
    33Donate link: http://www.djudorange.fr/donate/
    44Tags: custom, fields, custom fields, term meta, meta, post meta, object meta, editor
    5 Requires at least: 3.0.0
    6 Tested up to: 3.0.1
    7 Stable tag: 2.2.2
     5Requires at least: 3.0.2
     6Tested up to: 3.3.1
     7Stable tag: 3.0.2
    88
    99This plugin add custom fields for some things on WordPress, term taxonomy and custom object types
     
    3131
    3232== Changelog ==
     33* Version 3.0.2
     34    * Fix JS compatible with new Sortable JQuery UI
    3335* Version 3.0.1 :
    3436    * New Style of Admin page fields and in Post edit page
Note: See TracChangeset for help on using the changeset viewer.