Skip to content

Commit

Permalink
added shortcode support for get_the_value(), and the_value(), if not …
Browse files Browse the repository at this point in the history
…using these functions then the developer would have to manually call do_shortcode()
  • Loading branch information
farinspace committed May 8, 2011
1 parent d5b2e4b commit 0a821e7
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions WPAlchemy/MetaBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright Copyright (c) 2009, Dimas Begunoff, http://farinspace.com
* @license http://en.wikipedia.org/wiki/MIT_License The MIT License
* @package WPAlchemy
* @version 1.4.8
* @version 1.4.9
* @link http://github.com/farinspace/wpalchemy
* @link http://farinspace.com
*/
Expand Down Expand Up @@ -1612,6 +1612,8 @@ function get_the_value($n = NULL, $collection = FALSE)
{
$this->_meta(NULL, TRUE);

$value = null;

if ($this->in_loop)
{
if(isset($this->meta[$this->name]))
Expand All @@ -1624,14 +1626,14 @@ function get_the_value($n = NULL, $collection = FALSE)
{
if(isset($this->meta[$this->name][$this->current]))
{
return $this->meta[$this->name][$this->current];
$value = $this->meta[$this->name][$this->current];
}
}
else
{
if(isset($this->meta[$this->name][$this->current][$n]))
{
return $this->meta[$this->name][$this->current][$n];
$value = $this->meta[$this->name][$this->current][$n];
}
}
}
Expand All @@ -1641,14 +1643,14 @@ function get_the_value($n = NULL, $collection = FALSE)
{
if(isset($this->meta[$this->name]))
{
return $this->meta[$this->name];
$value = $this->meta[$this->name];
}
}
else
{
if(isset($this->meta[$this->name][$this->current]))
{
return $this->meta[$this->name][$this->current];
$value = $this->meta[$this->name][$this->current];
}
}
}
Expand All @@ -1658,10 +1660,20 @@ function get_the_value($n = NULL, $collection = FALSE)
{
$n = is_null($n) ? $this->name : $n ;

if(isset($this->meta[$n])) return $this->meta[$n];
if(isset($this->meta[$n]))
{
$value = $this->meta[$n];
}
}

return NULL;
if ($this->in_template)
{
return $value;
}
else
{
return do_shortcode($value);
}
}

/**
Expand Down

0 comments on commit 0a821e7

Please sign in to comment.