Skip to content

Commit

Permalink
Added multiple_choid to OptionPage, some changes in PostObject and fi…
Browse files Browse the repository at this point in the history
…xed image fields in RegisterMetabox
  • Loading branch information
sergiopvilar committed Jul 14, 2014
1 parent c49cfaf commit 67bcf96
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/api/OptionPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ private function parseFields(){
$obj = Form::textarea($key);
break;

case 'multiple_choice':

$obj = Form::checkboxes($key."[]"); // create a collection of checkboxeseaa

foreach($value['options'] as $o => $v){
$obj->add($o, $v);
}

break;

default:
$obj = Form::text($key);

Expand Down
3 changes: 3 additions & 0 deletions src/core/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function __construct($postObject, $model){

$this->author = $author;

$this->content = apply_filters('the_content', $this->content);

// Terms
if( !empty($taxonomies))

Expand All @@ -48,6 +50,7 @@ public function __construct($postObject, $model){
$terms = array();
$obj = get_the_terms( $this->ID, $taxonomy );

if(is_array($obj))
foreach($obj as $term){
$term->link = get_term_link($term->term_id, $taxonomy);
array_push($terms, $term);
Expand Down
2 changes: 1 addition & 1 deletion src/utility/RegisterMetabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function doRegister(){

case 'image':

if(!$content['multiple']){
if(empty($content['multiple'])){

array_push($box['fields'], array(
'name' => $content['label'],
Expand Down

0 comments on commit 67bcf96

Please sign in to comment.