Skip to content

Commit

Permalink
Update helper to get data from page template - Version bump to 3.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Parziale committed Oct 4, 2019
1 parent 91be4ca commit 087ad83
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 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.4';
public const VERSION = '3.0.5';
/**
* Constructs the Aeria container
*
Expand Down
25 changes: 14 additions & 11 deletions Aeria/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if (!function_exists('dump')) {
/**
* Dumps the provided arguments
*
*
* @param mixed ...$args the dumpable args
*
* @return void
Expand Down Expand Up @@ -58,7 +58,7 @@ function ($value) {
if (!function_exists('dd')) {
/**
* Dumps the provided arguments than dies
*
*
* @param mixed ...$args the dumpable args
*
* @return void
Expand All @@ -76,7 +76,7 @@ function dd(...$args)
if (!function_exists('toSnake')) {
/**
* Converts camelCase to snake_case
*
*
* @param string $convertible_text the text to convert
*
* @return string the converted text
Expand All @@ -101,7 +101,7 @@ function toSnake($convertible_text)
if (!function_exists('aeria')) {
/**
* Returns Aeria's instance
*
*
* @param string $abstract the requested service
*
* @return mixed the service or Aeria's instance
Expand All @@ -118,7 +118,7 @@ function aeria(/* ?string */ $abstract = null)
}
/**
* Returns Aeria's fields
*
*
* @param WP_Post $post the current post
*
* @return array the retrieved fields
Expand All @@ -139,7 +139,10 @@ function get_aeria_fields($post)
['id' => $name],
$data
);
if( !in_array($post->post_type, $metabox["post_type"])){
if( $post->post_type !== 'page' && !in_array($post->post_type, $metabox["post_type"])){
continue;
}
if($post->post_type === 'page' && !in_array(get_page_template_slug($post), $metabox["templates"])){
continue;
}
$processor = new MetaProcessor($post->ID, $metabox, $sections, $render_service);
Expand All @@ -150,7 +153,7 @@ function get_aeria_fields($post)
}
/**
* Returns an Aeria field
*
*
* @param WP_Post $post the current post
* @param string $metabox the metabox ID
* @param string $id the field's ID
Expand All @@ -172,7 +175,7 @@ function get_aeria_field($post, $metabox, $id)
}
/**
* Returns an Aeria metabox's fields
*
*
* @param WP_Post $post the current post
* @param string $metabox the metabox ID
*
Expand All @@ -199,7 +202,7 @@ function get_aeria_metabox($post, $metabox)
}
/**
* Returns Aeria's options
*
*
* @param string $option_page the page we're checking
*
* @return array the retrieved fields
Expand All @@ -222,7 +225,7 @@ function get_aeria_options($option_page)
}
/**
* Saves Aeria's provided fields
*
*
* @param array $saving_data the data we're saving
*
* @return void
Expand All @@ -241,7 +244,7 @@ function save_aeria_fields(array $saving_data)

/**
* Flattens an array
*
*
* @param array $to_be_normalized the array we want to normalize
* @param int $times the times to normalize the array
*
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.4
* Version: 3.0.5
* Author: Caffeina
* Author URI: https://caffeina.com
* Text Domain: aeria
Expand Down

0 comments on commit 087ad83

Please sign in to comment.