HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: /volume1/web/Marchisa-Toman/wp-content/plugins/meta-box-builder/src/RestApi/ShowHide.php
<?php
namespace MBB\RestApi;

use WP_REST_Request;

class ShowHide extends Base {
	public function show_hide( WP_REST_Request $request ) {
		$name = $request->get_param( 'name' );
		$s    = strtolower( $request->get_param( 's' ) );

		$method = $this->get_method( $name );
		return $this->$method( $s, $name );
	}

	private function get_method( $name ): string {
		$methods = [
			'template' => 'get_templates',
			'format'   => 'get_formats',
		];
		$method  = $methods[ $name ] ?? 'get_terms';

		return $method;
	}
}