Plugin Directory

Changeset 2702672


Ignore:
Timestamp:
03/31/2022 12:15:19 PM (4 years ago)
Author:
abigegg
Message:

Commit 1.1.0 to trunk

Location:
hatch
Files:
2 edited
7 copied

Legend:

Unmodified
Added
Removed
  • hatch/trunk/abe-hatch.php

    r2700848 r2702672  
    33 * Plugin name: Hatch
    44 * Author: A Big Egg
    5  * Version: 1.0.0
     5 * Version: 1.1.0
    66 * Description: Provides helper functions for working with Timber and ACF. Requires Timber (timber-library) and works well with Advanced Custom Fields Pro and Gravity Forms.
    77 */
     
    2020    public function __construct()
    2121    {
    22         register_activation_hook(__FILE__, [ $this, 'activate_plugin' ]);
    23        
    24    
    2522        // ensure that post objects from ACF are passed through our transformation function
    2623        add_filter('acf/format_value/type=post_object', [ $this, 'construct_post' ], 50);
  • hatch/trunk/inc/image.php

    r2634970 r2702672  
    3434        return $img[0];
    3535    }
     36
     37    /**
     38     * Get the image path on the disk
     39     * @param  mixed $size  The size of the image
     40     * @return string      The path to the image
     41     */
     42    public function path($size = 'thumbnail')
     43    {
     44        return get_attached_file($this->attachment_id, $size);
     45    }
     46
    3647   
    3748    /**
Note: See TracChangeset for help on using the changeset viewer.