Plugin Directory

Changeset 1530543


Ignore:
Timestamp:
11/08/2016 05:07:34 PM (9 years ago)
Author:
caalami
Message:

tagging version 1.2.8

Location:
acf-link-picker-field
Files:
3 edited
5 copied

Legend:

Unmodified
Added
Removed
  • acf-link-picker-field/tags/1.2.8/acf-link_picker.php

    r1515612 r1530543  
    55Plugin URI: https://github.com/ahebrank/ACF-Link-Picker-Field
    66Description: Adds an Advanced Custom Field field that allows the selection of a link utilising the WordPress link picker modal dialog
    7 Version: 1.2.7
     7Version: 1.2.8
    88Authors: Steve Marks (BIOSTALL), Andy Hebrank (caalami)
    99Author URI: http://biostall.com
  • acf-link-picker-field/tags/1.2.8/js/input.js

    r1515074 r1530543  
    1818
    1919    function get_postid(url, field_id) {
     20
     21        // make sure we're ACF 5 and support post ID lookup
     22        if (!$('#' + field_id + '-postid').length) {
     23            return;
     24        }
    2025
    2126        // lookup the post_id by url, set value on a hidden field
     
    3035            var id = response.field_id;
    3136
    32             $('#' + id + '-postid').val(post_id);
    33             $('#' + id + '-postid-label').html(post_id);
     37            if ($('#' + id + '-postid').length && $('#' + id + '-postid-label').length) {
     38                $('#' + id + '-postid').val(post_id);
     39                $('#' + id + '-postid-label').html(post_id);
     40            }
    3441        }, 'json');
    3542    }
     
    8592            $('#' + doingLink + '-title').val('');
    8693            $('#' + doingLink + '-target').val('');
    87             $('#' + doingLink + '-postid').val('');
     94
     95            if ($('#' + doingLink + '-postid').length) {
     96                $('#' + doingLink + '-postid').val('');
     97            }
    8898           
    8999            $('#' + doingLink + '-none').show();
     
    114124        if (url) {
    115125            var $postid_input = $el.find('input[name$="[postid]"]');
    116             var post_id = $postid_input.val();
    117             if (!post_id || post_id == 0) {
    118                 get_postid(url, $postid_input.attr('id').replace('-postid', ''));
     126            // check input exists
     127            if ($postid_input.length) {
     128                var post_id = $postid_input.val();
     129                if (!post_id || post_id == 0) {
     130                    get_postid(url, $postid_input.attr('id').replace('-postid', ''));
     131                }
    119132            }
    120133        }
  • acf-link-picker-field/tags/1.2.8/readme.txt

    r1515612 r1530543  
    2525*   ACF 5
    2626*   ACF 4
     27
     28*ACF 4 support is deprecated, and new plugin features will generally not work with ACF 4.*
    2729
    2830== Installation ==
     
    6062
    6163== Changelog ==
     64
     65= 1.2.8 =
     66* Some additional compatibility checks for ACF 4 (disable post ID lookups to suppress JS errors)
    6267
    6368= 1.2.7 =
  • acf-link-picker-field/trunk/acf-link_picker.php

    r1515612 r1530543  
    55Plugin URI: https://github.com/ahebrank/ACF-Link-Picker-Field
    66Description: Adds an Advanced Custom Field field that allows the selection of a link utilising the WordPress link picker modal dialog
    7 Version: 1.2.7
     7Version: 1.2.8
    88Authors: Steve Marks (BIOSTALL), Andy Hebrank (caalami)
    99Author URI: http://biostall.com
  • acf-link-picker-field/trunk/js/input.js

    r1515074 r1530543  
    1818
    1919    function get_postid(url, field_id) {
     20
     21        // make sure we're ACF 5 and support post ID lookup
     22        if (!$('#' + field_id + '-postid').length) {
     23            return;
     24        }
    2025
    2126        // lookup the post_id by url, set value on a hidden field
     
    3035            var id = response.field_id;
    3136
    32             $('#' + id + '-postid').val(post_id);
    33             $('#' + id + '-postid-label').html(post_id);
     37            if ($('#' + id + '-postid').length && $('#' + id + '-postid-label').length) {
     38                $('#' + id + '-postid').val(post_id);
     39                $('#' + id + '-postid-label').html(post_id);
     40            }
    3441        }, 'json');
    3542    }
     
    8592            $('#' + doingLink + '-title').val('');
    8693            $('#' + doingLink + '-target').val('');
    87             $('#' + doingLink + '-postid').val('');
     94
     95            if ($('#' + doingLink + '-postid').length) {
     96                $('#' + doingLink + '-postid').val('');
     97            }
    8898           
    8999            $('#' + doingLink + '-none').show();
     
    114124        if (url) {
    115125            var $postid_input = $el.find('input[name$="[postid]"]');
    116             var post_id = $postid_input.val();
    117             if (!post_id || post_id == 0) {
    118                 get_postid(url, $postid_input.attr('id').replace('-postid', ''));
     126            // check input exists
     127            if ($postid_input.length) {
     128                var post_id = $postid_input.val();
     129                if (!post_id || post_id == 0) {
     130                    get_postid(url, $postid_input.attr('id').replace('-postid', ''));
     131                }
    119132            }
    120133        }
  • acf-link-picker-field/trunk/readme.txt

    r1515612 r1530543  
    2525*   ACF 5
    2626*   ACF 4
     27
     28*ACF 4 support is deprecated, and new plugin features will generally not work with ACF 4.*
    2729
    2830== Installation ==
     
    6062
    6163== Changelog ==
     64
     65= 1.2.8 =
     66* Some additional compatibility checks for ACF 4 (disable post ID lookups to suppress JS errors)
    6267
    6368= 1.2.7 =
Note: See TracChangeset for help on using the changeset viewer.