| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/KnowledgeBase/wp-content/plugins/wp-seopress-pro/src/Core/ |
Upload File : |
<?php
namespace SEOPressPro\Core;
defined('ABSPATH') || exit;
abstract class FormApi {
protected function getTypeByField($field) {
return 'input';
}
protected function getLabelByField($field) {
return '';
}
protected function getDescriptionByField($field) {
return '';
}
protected function getPlaceholderByField($field) {
return '';
}
protected function getOptions($field) {
return [];
}
abstract protected function getDetails();
public function getFields($postId = null) {
$fields = $this->getDetails($postId);
foreach ($fields as $key => $field) {
$fields[$key]['type'] = $this->getTypeByField($field['key']);
$fields[$key]['label'] = $this->getLabelByField($field['key']);
$fields[$key]['description'] = $this->getDescriptionByField($field['key']);
$fields[$key]['placeholder'] = $this->getPlaceholderByField($field['key']);
$fields[$key]['visible'] = true;
if ('select' === $fields[$key]['type']) {
$fields[$key]['options'] = $this->getOptions($field['key']);
}
}
return $fields;
}
}