Fixes indentations and more refactors

This commit is contained in:
Rodrigo de Oliveira 2021-03-12 02:35:42 -03:00
parent 246e5b92d3
commit 5fe6c41546
2 changed files with 21 additions and 22 deletions

View File

@ -45,7 +45,7 @@ class Taxonomy extends Entity {
static $db_identifier_prefix = 'tnc_tax_';
public function __toString() {
return apply_filters("tainacan-taxonomy-to-string", $this->get_name(), $this);
return (string) apply_filters("tainacan-taxonomy-to-string", $this->get_name(), $this);
}
/**
@ -54,18 +54,19 @@ class Taxonomy extends Entity {
* @return bool
*/
function tainacan_register_taxonomy() {
$taxonomy_name = $this->get_name();
$labels = array(
'name' => $this->get_name(),
'singular_name' => $this->get_name(),
'search_items' => __( sprintf('Search terms in %s', $this->get_name()), 'tainacan' ),
'all_items' => __( sprintf('All terms in %s', $this->get_name()), 'tainacan' ),
'name' => $taxonomy_name,
'singular_name' => $taxonomy_name,
'search_items' => __( sprintf('Search terms in %s', $taxonomy_name), 'tainacan' ),
'all_items' => __( sprintf('All terms in %s', $taxonomy_name), 'tainacan' ),
'parent_item' => __( 'Parent term', 'tainacan' ),
'parent_item_colon' => __( 'Parent term:', 'tainacan' ),
'edit_item' => __( 'Edit term', 'tainacan' ),
'update_item' => __( 'Update term', 'tainacan' ),
'add_new_item' => __( 'Add New term', 'tainacan' ),
'new_item_name' => __( 'New Genre term', 'tainacan' ),
'menu_name' => $this->get_name(),
'menu_name' => $taxonomy_name,
);
$enabled_post_types = $this->get_enabled_post_types();
@ -88,8 +89,6 @@ class Taxonomy extends Entity {
unregister_taxonomy($this->get_db_identifier());
}
register_taxonomy(
$this->get_db_identifier(),
$enabled_post_types,