Skip to content

Commit

Permalink
Update carpenter to support taxonomy DB changes in 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wkirby committed Apr 29, 2016
1 parent 43bc3a5 commit 401e97c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion carpenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Plugin Name: Carpenter
* Version: 1.2.6
* Version: 1.2.7
* Author: Apsis Labs
* Author URI: www.apsis.io
*/
Expand Down
7 changes: 1 addition & 6 deletions core/taxonomy.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function __construct($name, $postType, $args = array()) {
public function register() {
if ( ! taxonomy_exists($this->slug) ) {
register_taxonomy( $this->slug, $this->postType, $this->options );

if ( $this->defaults ) {
$this->registerDefaults();
}
Expand Down Expand Up @@ -101,12 +100,10 @@ public function defaultActionsRow($actions, $term) {
protected function registerDefaults() {
foreach ($this->defaults as $slug => $term) {
if ( !get_term_by('slug', $slug, $this->slug) ) {

print_r($term);
$options = isset($term['options']) ? $term['options'] : array();

$options = wp_parse_args($options, array(
'description' => null,
'description' => "",
'slug' => $slug,
'parent' => 0
));
Expand All @@ -116,8 +113,6 @@ protected function registerDefaults() {
$options['parent'] = $parent ? $parent->term_id : 0;
}

echo $options['slug'];

// Format the Name
$name = isset($term['name']) ? (string) $term['name'] : $this->createLabel($slug);
wp_insert_term($name, $this->slug, $options);
Expand Down

0 comments on commit 401e97c

Please sign in to comment.