WordPress.org

Plugin Directory

Changeset 571356


Ignore:
Timestamp:
07/12/12 17:40:42 (21 months ago)
Author:
brasofilo
Message:

Version 1.2

Location:
featured-link-image
Files:
17 added
2 edited

Legend:

Unmodified
Added
Removed
  • featured-link-image/trunk/featured-link-image.php

    r539747 r571356  
    88Author: Rodolfo Buaiz 
    99Author URI: http://rodbuaiz.com/ 
    10 Stable Tag: 1.1 
    11 Version: 1.1 
     10Stable Tag: 1.2 
     11Version: 1.2 
    1212License: GPL 
    1313*/ 
     
    6363 
    6464        // Hide many image details and From Url insert option 
    65         echo '<style type="text/css">#media-upload-header #sidemenu li#tab-type_url,tr.post_excerpt,tr.post_content,tr.url,tr.align,tr.image_alt, tr.post_title.form-required{display: none !important;}</style>'; 
     65        echo '<style type="text/css">#media-upload-header #sidemenu li#tab-type_url,tr.post_excerpt,tr.post_content,tr.align,tr.image_alt, tr.post_title.form-required{display: none !important;}</style>'; 
    6666 
    6767        // Refresh upload screen every half second 
     
    6969        $select = __("Select link image", 'fli'); 
    7070        $tab     = isset($_GET['tab']) ? $_GET['tab'] : "type"; 
    71         $refresh = ($tab == 'type') ? 'var mtt_t = setInterval(function(){$("#media-items").each(setButtonNames); $("p.savebutton").css("display", "none");}, 500);' : ''; 
     71        $refresh = ($tab == 'type') ? 'var mtt_t = setInterval(function(){$("#media-items").each(setButtonNames); $("p.savebutton").css("display", "none"); $("tr.url").find("p.help").html("<strong>Make sure you select &gt;File URL&lt;</strong><br />"); }, 500);' : ''; 
    7272 
    7373        $js = <<<EOM 
     
    7878                    jQuery(document).ready(function($){ 
    7979                        $('#media-items').each(setButtonNames); 
     80                        $('tr.url').find('p.help').html('<strong>Make sure you select &gt;File URL&lt;</strong><br />'); 
    8081                        {$refresh} 
    8182                    }); 
     
    105106 * Sort multidimensional array by stdClass 
    106107 */ 
    107 function sort_on_field(&$objects, $on, $order = 'ASC') { 
    108     $comparer = ($order === 'DESC') 
    109         ? "return -strcmp(\$a->{$on},\$b->{$on});" 
    110         : "return strcmp(\$a->{$on},\$b->{$on});"; 
    111     usort($objects, create_function('$a,$b', $comparer)); 
     108function brsfl_sort_on_field( &$db, $col, $order = SORT_ASC ) 
     109{ 
     110    $sort = array(); 
     111    foreach ($db as $i => $obj) { 
     112        $sort[$i] = $obj->{$col}; 
     113    } 
     114    $sorted_db = array_multisort($sort, $order, $db); 
    112115} 
    113116 
     
    156159    if($current_screen->id == 'link-manager' && $_GET['orderby'] == 'link_image') 
    157160    { 
    158         $order = ($_GET['order'] === 'asc') ? 'ASC' : 'DESC'; 
    159         sort_on_field($links, 'link_image', $order); 
     161        $order = ($_GET['order'] === 'asc') ? SORT_ASC : SORT_DESC; 
     162        brsfl_sort_on_field($links, 'link_image', $order); 
    160163        return $links; 
    161164    } else return $links; 
  • featured-link-image/trunk/readme.txt

    r539748 r571356  
    22Tags: image, featured image, links, media library, bookmarks, blogroll 
    33Requires at least: 3.1 
    4 Tested up to: 3.4-beta4 
    5 Stable tag: 1.1 
     4Tested up to: 3.4.1 
     5Stable tag: 1.2 
    66Contributors: brasofilo 
    77 
     
    3535 
    3636== Changelog == 
     37**Version 1.2** 
     38 
     39* Revised compatibility with WordPress 3.4.1 
     40* File URL now visible in the upload window with warning text about the Link URL to use 
     41 
    3742**Version 1.1** 
    3843 
Note: See TracChangeset for help on using the changeset viewer.