for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WPDFI;
/**
* This class handle all actions related with taxonomy
*
* @author Duc Bui Quang <[email protected]>
* @since 1.0.0
*/
use WPDFI\Traits\Singleton;
final class Taxonomy
{
use Singleton;
* @traitDoc
public function initializes()
//
}
* Get all taxonomy name and label by given post type name
* @param string $post_type
* @return array
public function get($post_type) {
$data = [];
if($post_type) {
foreach(\get_object_taxonomies($post_type, 'objects') as $index => $taxonomy) {
// Only accept taxonomies which visible to admin and reader
if($taxonomy->show_ui and $taxonomy->show_in_menu) {
$data[$index]['name'] = $taxonomy->name;
$data[$index]['label'] = $taxonomy->label;
return $data;
* Get taxonomy label from taxonomy name
* @param string $taxonomy_name
$taxonomy_name
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return string
public function get_label_from_name($name) {
return \get_taxonomy_labels(['name' => $name]);