HEX
Server: Apache
System: Linux uws7-179.cafe24.com 3.10.0-1160.119.1p.el7.x86_64 #1 SMP Thu Sep 11 14:15:01 KST 2025 x86_64
User: medikors (1589)
PHP: 7.3.1p1
Disabled: mysql_pconnect
Upload Files
File: /medikors/www/wp-content/plugins/raven/includes/modules/categories/module.php
<?php

namespace Raven\Modules\Categories;

defined( 'ABSPATH' ) || die();

use Raven\Base\Module_base;

class Module extends Module_Base {

	public function get_widgets() {
		return [ 'categories' ];
	}

	public function __construct() {
		parent::__construct();

		add_action( 'wp_ajax_raven_categories_editor', [ $this, 'handle_editor' ] );
	}

	public static function get_taxonomy( $post_type ) {
		$taxonomy_map = [
			'blog' => 'category',
			'portfolio' => 'portfolio_category',
			'product' => 'product_cat',
		];

		return $taxonomy_map[ $post_type ];
	}

	public function handle_editor() {
		$post_type = filter_input( INPUT_POST, 'post_type' );

		$args = [
			'taxonomy' => self::get_taxonomy( $post_type ),
		];

		wp_send_json_success( get_terms( $args ) );
	}

}