Changeset 648176
- Timestamp:
- 01/05/2013 03:46:51 AM (13 years ago)
- Location:
- acf-single-relationship-add-new
- Files:
-
- 16 added
- 3 edited
-
tags/1.1 (added)
-
tags/1.1/acf-single-relationship-add-new.php (added)
-
tags/1.1/css (added)
-
tags/1.1/css/asran-admin.css (added)
-
tags/1.1/css/colorbox.css (added)
-
tags/1.1/css/images (added)
-
tags/1.1/css/images/border.png (added)
-
tags/1.1/css/images/controls.png (added)
-
tags/1.1/css/images/loading.gif (added)
-
tags/1.1/css/images/loading_background.png (added)
-
tags/1.1/js (added)
-
tags/1.1/js/asran-post.js (added)
-
tags/1.1/js/jquery.colorbox-min.js (added)
-
tags/1.1/readme.txt (added)
-
tags/1.1/screenshot-1.jpg (added)
-
tags/1.1/screenshot-2.jpg (added)
-
trunk/acf-single-relationship-add-new.php (modified) (4 diffs)
-
trunk/js/asran-post.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acf-single-relationship-add-new/trunk/acf-single-relationship-add-new.php
r624978 r648176 4 4 Plugin URI: http://hosting.fancyfiber.com/acf-single-relationship-add-new/ 5 5 Description: With Advanced Custom Fields Installed, relationship fields with a single post type attached will get an "Add New" button. Which will open in a colorbox to add a new item, with out leaving the current item. 6 Version: 1. 06 Version: 1.1 7 7 Author: Fancy Fiber Designs 8 8 Author URI: http://hosting.fancyfiber.com/design/ … … 11 11 12 12 function asran_admin_scripts($hook) { 13 $asran_custom_admin_url = array( 'admin_url' => admin_url() ); 14 13 15 switch($hook) { 14 16 case 'post.php': … … 17 19 wp_enqueue_script('asran-post', plugins_url('/js/asran-post.js', __FILE__), array('jquery', 'colorbox')); 18 20 wp_enqueue_style('colorbox-css', plugins_url('/css/colorbox.css', __FILE__)); 21 wp_localize_script( 'asran-post', 'asran_custom', $asran_custom_admin_url ); 19 22 } else { 20 23 wp_enqueue_style('asran-admin-css', plugins_url('/css/asran-admin.css', __FILE__)); … … 28 31 wp_enqueue_script('asran-post', plugins_url('/js/asran-post.js', __FILE__), array('jquery', 'colorbox')); 29 32 wp_enqueue_style('colorbox-css', plugins_url('/css/colorbox.css', __FILE__)); 33 wp_localize_script( 'asran-post', 'asran_custom', $asran_custom_admin_url ); 30 34 } 31 35 break; -
acf-single-relationship-add-new/trunk/js/asran-post.js
r624962 r648176 18 18 if($(this).is('.row-clone .acf_relationship')) { 19 19 if($(this).is('.row_layout .acf_relationship')) { 20 $(this).closest('tr').find('.label').prepend('<ul class="hl"><li class="right"><a href=" /wp-admin/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe repeater">Add New</a></li></ul>');20 $(this).closest('tr').find('.label').prepend('<ul class="hl"><li class="right"><a href="' + asran_custom.admin_url + '/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe repeater">Add New</a></li></ul>'); 21 21 } else { 22 22 //Find the column number the field is in so we can put the Add New button in the header. 23 23 var col = $(this).closest('td').index(); 24 24 //Add the Colobox link and button to the proper location 25 $(this).closest('table').find('tr > *:eq(' + col + ')').prepend('<ul class="hl"><li class="right"><a href=" /wp-admin/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe repeater">Add New</a></li></ul>');25 $(this).closest('table').find('tr > *:eq(' + col + ')').prepend('<ul class="hl"><li class="right"><a href="' + asran_custom.admin_url + '/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe repeater">Add New</a></li></ul>'); 26 26 } 27 27 } else { … … 29 29 if(!$(this).is('.row .acf_relationship')) { 30 30 //Add the Colobox link and button to the proper location and fix the line up of the label. 31 $(this).closest('.field-relationship').find('p').append('<ul class="hl clearfix repeater-footer"><li class="right"><a href=" /wp-admin/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe non-repeater">Add New</a></li></ul>');31 $(this).closest('.field-relationship').find('p').append('<ul class="hl clearfix repeater-footer"><li class="right"><a href="' + asran_custom.admin_url + '/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe non-repeater">Add New</a></li></ul>'); 32 32 $(this).closest('.field-relationship').find('label').css('float','left'); 33 33 } else { 34 34 if($(this).is('.row_layout .acf_relationship')) { 35 $(this).closest('tr').find('.label').prepend('<ul class="hl"><li class="right"><a href=" /wp-admin/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe repeater">Add New</a></li></ul>');35 $(this).closest('tr').find('.label').prepend('<ul class="hl"><li class="right"><a href="' + asran_custom.admin_url + '/post-new.php?post_type=' + posttypes + '&asran-colorbox=true" class="acf-button add-post cboxElement iframe repeater">Add New</a></li></ul>'); 36 36 } 37 37 } -
acf-single-relationship-add-new/trunk/readme.txt
r624978 r648176 5 5 Requires at least: 3.0.0 6 6 Tested up to: 3.4.2 7 Version: 1. 08 Stable tag: 1. 07 Version: 1.1 8 Stable tag: 1.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 57 57 == Changelog == 58 58 59 = 1.1 = 60 Fix bug when WordPress is installed in a subdirectory rather than the root. Thanks to Scott Nath for the fix. 61 59 62 = 1.0 = 60 63 Initial Release
Note: See TracChangeset
for help on using the changeset viewer.