This repository has been archived by the owner on Mar 27, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/develop'
- Loading branch information
Showing
20 changed files
with
383 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
<?php | ||
|
||
class KT_WP_Editor_Field extends KT_Field{ | ||
class KT_WP_Editor_Field extends KT_Field { | ||
|
||
const FIELD_TYPE = "wp-editor"; | ||
|
||
public function __construct($name, $label) { | ||
parent::__construct($name, $label); | ||
$this->setFilterSanitize(FILTER_DEFAULT); | ||
} | ||
|
||
// --- gettery a settery --- | ||
|
||
public function getField() { | ||
$this->renderField(); | ||
} | ||
|
||
public function renderField() { | ||
wp_editor( $this->getValue(), $this->getName(), array( | ||
'media_buttons' => false, | ||
'textarea_name' => $this->getNameAttribute(), | ||
'textarea_rows' => 10, | ||
'teeny' => false, | ||
'quicktags' => false | ||
)); | ||
} | ||
|
||
public function getFieldType(){ | ||
|
||
// --- gettery a settery --------------------------- | ||
|
||
public function getFieldType() { | ||
return self::FIELD_TYPE; | ||
} | ||
|
||
protected function getNameAttribute() { | ||
$html = ""; | ||
$afterNameString = static::getAfterNameValue(); | ||
|
||
if (KT::issetAndNotEmpty($this->getPostPrefix())) { | ||
$html .= "{$this->getPostPrefix()}[{$this->getName()}]$afterNameString"; | ||
return "{$this->getPostPrefix()}[{$this->getName()}]$afterNameString"; | ||
} else { | ||
$html .= "{$this->getName()}$afterNameString"; | ||
return "{$this->getName()}$afterNameString"; | ||
} | ||
|
||
return $html; | ||
} | ||
|
||
public function getField() { | ||
$this->renderField(); | ||
} | ||
|
||
// --- veřejné metody --------------------------- | ||
|
||
public function renderField() { | ||
wp_editor($this->getValue(), $this->getName(), array( | ||
"media_buttons" => false, | ||
"textarea_name" => $this->getNameAttribute(), | ||
"textarea_rows" => 10, | ||
"teeny" => false, | ||
"quicktags" => false | ||
)); | ||
} | ||
|
||
} |
Oops, something went wrong.