Plugin Directory

Changeset 720768


Ignore:
Timestamp:
05/31/2013 10:08:26 AM (13 years ago)
Author:
PeterHudec
Message:

Updatedd to version 0.3.

Location:
attachment-cruncher/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • attachment-cruncher/trunk/README.txt

    r720327 r720768  
    55Requires at least: 2.7
    66Tested up to: 3.5.1
    7 Stable tag: 0.2
     7Stable tag: 0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6262
    6363Copy the **attachment-cruncher** folder into the plugins directory and activate.
    64 PHP 5.3 or higher is required (the plugin uses anonymous functions).
    6564
    6665== Screenshots ==
     
    6968
    7069== Changelog ==
     70
     71= 0.3 =
     72* Works now also with PHP 5.2.
    7173
    7274= 0.2 =
  • attachment-cruncher/trunk/attachment-cruncher.php

    r720327 r720768  
    33Plugin Name: Attachment Cruncher
    44Description: A Swiss Army Knife for transfering media attachment properties to post properties.
    5 Version: 0.2
     5Version: 0.3
    66Author: Peter Hudec
    77Author URI: http://peterhudec.com
     
    1515   
    1616    public $plugin_name = 'Attachment Cruncher';
    17     private $version = 0.2;
     17    private $version = 0.3;
    1818    private $prefix = 'attachment_cruncher';
    1919    private $settings_slug = 'attachment-cruncher';
     
    130130     * Returns IDs of all atachments attached to the post.
    131131     */
    132     private function get_attached_attachments( $post_id ) {
     132    public function get_attached_attachments( $post_id ) {
    133133       
    134134        // Collect attachments objects
     
    140140        ) );
    141141       
     142        function attachment_id( $attachment ){
     143            return $attachment->ID;
     144        }
     145       
    142146        // Return only IDs.
    143         return array_map( function ( $attachment ) {
    144             return $attachment->ID;
    145         }, $attachment_posts );
     147        return array_map( 'attachment_id', $attachment_posts );
    146148    }
    147149   
Note: See TracChangeset for help on using the changeset viewer.