Plugin Directory

Changeset 648176


Ignore:
Timestamp:
01/05/2013 03:46:51 AM (13 years ago)
Author:
fancyfiber
Message:

New version for bug fix.

Location:
acf-single-relationship-add-new
Files:
16 added
3 edited

Legend:

Unmodified
Added
Removed
  • acf-single-relationship-add-new/trunk/acf-single-relationship-add-new.php

    r624978 r648176  
    44Plugin URI: http://hosting.fancyfiber.com/acf-single-relationship-add-new/
    55Description: 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.0
     6Version: 1.1
    77Author: Fancy Fiber Designs
    88Author URI: http://hosting.fancyfiber.com/design/
     
    1111
    1212function asran_admin_scripts($hook) {
     13   $asran_custom_admin_url = array( 'admin_url' => admin_url() );
     14
    1315   switch($hook) {
    1416      case 'post.php':
     
    1719            wp_enqueue_script('asran-post', plugins_url('/js/asran-post.js', __FILE__), array('jquery', 'colorbox'));
    1820            wp_enqueue_style('colorbox-css', plugins_url('/css/colorbox.css', __FILE__));
     21            wp_localize_script( 'asran-post', 'asran_custom', $asran_custom_admin_url );
    1922         } else {
    2023            wp_enqueue_style('asran-admin-css', plugins_url('/css/asran-admin.css', __FILE__));
     
    2831            wp_enqueue_script('asran-post', plugins_url('/js/asran-post.js', __FILE__), array('jquery', 'colorbox'));
    2932            wp_enqueue_style('colorbox-css', plugins_url('/css/colorbox.css', __FILE__));
     33            wp_localize_script( 'asran-post', 'asran_custom', $asran_custom_admin_url );
    3034         }
    3135         break;
  • acf-single-relationship-add-new/trunk/js/asran-post.js

    r624962 r648176  
    1818            if($(this).is('.row-clone .acf_relationship')) {
    1919               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>');
    2121               } else {
    2222                  //Find the column number the field is in so we can put the Add New button in the header.
    2323                  var col = $(this).closest('td').index();
    2424                  //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>');
    2626               }
    2727            } else {
     
    2929               if(!$(this).is('.row .acf_relationship')) {
    3030                  //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>');
    3232                  $(this).closest('.field-relationship').find('label').css('float','left');
    3333               } else {
    3434                  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>');
    3636                  }
    3737               }
  • acf-single-relationship-add-new/trunk/readme.txt

    r624978 r648176  
    55Requires at least: 3.0.0
    66Tested up to: 3.4.2
    7 Version: 1.0
    8 Stable tag: 1.0
     7Version: 1.1
     8Stable tag: 1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5757== Changelog ==
    5858
     59= 1.1 =
     60Fix bug when WordPress is installed in a subdirectory rather than the root. Thanks to Scott Nath for the fix.
     61
    5962= 1.0 =
    6063Initial Release
Note: See TracChangeset for help on using the changeset viewer.