Skip to content
This repository was archived by the owner on Oct 23, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions includes/class-super-custom-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public function register_post_type( $customizations = array() ) {
unset( $customizations['menu_icon'] ); # here we unset it because it will get set properly in the default array
}

$this->cpt = array_merge_recursive(
apply_filters( 'scpt_plugin_default_cpt_options', array(
$defaults = apply_filters( 'scpt_plugin_default_cpt_options', array(
'label' => $this->plural,
'labels' => array(
'name' => _x( $this->plural, $this->type ),
Expand Down Expand Up @@ -131,8 +130,11 @@ public function register_post_type( $customizations = array() ) {
# 'rewrite' => true,
# 'query_var' => true,
# 'can_export' => true,
), $this->type ),
$customizations
), $this->type );

$this->cpt = wp_parse_args(
$customizations,
$defaults
);

$this->register_cpt_action();
Expand Down Expand Up @@ -242,4 +244,4 @@ public function __call( $name, $arguments ) {
}


?>
?>
10 changes: 6 additions & 4 deletions includes/class-super-custom-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public function __construct( $name, $singular = false, $plural = false, $acts_li
* @author Matthew Boynes
*/
public function register_taxonomy( $customizations = array(), $hierarchical = false ) {
$this->args = array_merge(
apply_filters( 'scpt_plugin_default_tax_options', array(
$defaults = apply_filters( 'scpt_plugin_default_tax_options', array(
'label' => $this->plural,
'labels' => array(
'name' => _x( $this->plural, $this->name ),
Expand Down Expand Up @@ -123,8 +122,11 @@ public function register_taxonomy( $customizations = array(), $hierarchical = fa
# 'rewrite' => true,
# 'capabilities' => array(),
# 'sort' => false,
), $this->name ),
$customizations
), $this->name );

$this->args = wp_parse_args (
$customizations,
$defaults
);

$this->register_tax_action();
Expand Down