Skip to content

Commit

Permalink
Add all meta data of attachment in picture field - Version bump to 3.…
Browse files Browse the repository at this point in the history
…0.12
  • Loading branch information
Alberto Parziale committed Oct 25, 2019
1 parent 0209c58 commit 9b78f9a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Aeria/Aeria.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
class Aeria extends Container
{
public const VERSION = '3.0.11';
public const VERSION = '3.0.12';
/**
* Constructs the Aeria container
*
Expand Down
16 changes: 9 additions & 7 deletions Aeria/Field/Fields/PictureField.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ public function get(array $saved_fields, bool $skip_filter = false)
{
$id = parent::get($saved_fields, true);
if (is_null($id)) {
return [];
return null;
}

$value = (int) $id;
$attachment = get_post($id);
$sizes = isset($this->config['get_sizes']) ? $this->config['get_sizes'] : get_intermediate_image_sizes();
$result = ['id' => $value];
$result = [
'meta' => $attachment,
];

foreach ($sizes as $size) {
$result[$size] = wp_get_attachment_image_src($value, $size);
Expand All @@ -47,10 +49,10 @@ public function get(array $saved_fields, bool $skip_filter = false)
}

return apply_filters(
'aeria_get_picture',
$result,
$this->config
);
'aeria_get_picture',
$result,
$this->config
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion aeria.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Aeria
* Plugin URI: https://github.com/caffeinalab/aeria
* Description: Aeria is a modular, lightweight, fast WordPress Application development kit.
* Version: 3.0.11
* Version: 3.0.12
* Author: Caffeina
* Author URI: https://caffeina.com
* Text Domain: aeria
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit338ddf3b9a5279de85d5b87a0ca28b14::getLoader();
return ComposerAutoloaderInit90e03e2dfe985392e1653de22bc948ce::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit338ddf3b9a5279de85d5b87a0ca28b14
class ComposerAutoloaderInit90e03e2dfe985392e1653de22bc948ce
{
private static $loader;

Expand All @@ -19,15 +19,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit338ddf3b9a5279de85d5b87a0ca28b14', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit90e03e2dfe985392e1653de22bc948ce', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit338ddf3b9a5279de85d5b87a0ca28b14', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit90e03e2dfe985392e1653de22bc948ce', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit338ddf3b9a5279de85d5b87a0ca28b14::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit90e03e2dfe985392e1653de22bc948ce::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -48,19 +48,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit338ddf3b9a5279de85d5b87a0ca28b14::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit90e03e2dfe985392e1653de22bc948ce::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire338ddf3b9a5279de85d5b87a0ca28b14($fileIdentifier, $file);
composerRequire90e03e2dfe985392e1653de22bc948ce($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequire338ddf3b9a5279de85d5b87a0ca28b14($fileIdentifier, $file)
function composerRequire90e03e2dfe985392e1653de22bc948ce($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
6 changes: 3 additions & 3 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit338ddf3b9a5279de85d5b87a0ca28b14
class ComposerStaticInit90e03e2dfe985392e1653de22bc948ce
{
public static $files = array (
'd675c376038c78b0d320f3c784804a3c' => __DIR__ . '/../..' . '/Aeria/helpers.php',
Expand All @@ -27,8 +27,8 @@ class ComposerStaticInit338ddf3b9a5279de85d5b87a0ca28b14
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit338ddf3b9a5279de85d5b87a0ca28b14::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit338ddf3b9a5279de85d5b87a0ca28b14::$prefixDirsPsr4;
$loader->prefixLengthsPsr4 = ComposerStaticInit90e03e2dfe985392e1653de22bc948ce::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit90e03e2dfe985392e1653de22bc948ce::$prefixDirsPsr4;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit 9b78f9a

Please sign in to comment.