Skip to content

Commit

Permalink
Fucking Schoolboy *facepalm*
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonybudd committed Jun 14, 2017
1 parent 4751e0b commit 1b5dc09
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/WP_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,19 @@ public function deleteMeta($key)
*/
public function get($attribute, $default = NULL)
{
if(isset($this->data[$attribute])){
switch($attribute){
case 'the_content':
return apply_filters('the_content', $this->data[$attribute]);
break;
switch($attribute){
case 'the_content':
return apply_filters('the_content', $this->data['content']);
break;

default:
default:
if(isset($this->data[$attribute])){
return $this->data[$attribute];
break;
}
}

return $default;
}else{
return $default;
}
break;
}
}

/**
Expand Down
8 changes: 8 additions & 0 deletions test/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ function test(){
error(__LINE__ .' VIRTUAL PROPERTIES');
}

if(! ($product->the_content === "<p>content</p>\n") ){
error(__LINE__ .' VIRTUAL PROPERTIES');
}

$product->save();
$product = Product::find($product->ID);

Expand All @@ -123,6 +127,10 @@ function test(){
error(__LINE__ .' VIRTUAL PROPERTIES');
}

if(! ($product->the_content === "<p>content</p>\n") ){
error(__LINE__ .' VIRTUAL PROPERTIES');
}

// -----------------------------------------------------
// EVENTS
// -----------------------------------------------------
Expand Down

0 comments on commit 1b5dc09

Please sign in to comment.