Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 28 additions & 21 deletions admin-page-class/admin-page-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,14 @@ public function show_field_wysiwyg( $field, $meta ) {
echo "<textarea class='at-wysiwyg theEditor large-text".(isset($field['class'])? " {$field['class']}": "")."' name='{$field['id']}' id='{$field['id']}' cols='60' rows='10'>{$meta}</textarea>";
}else{
// Use new wp_editor() since WP 3.3
wp_editor( stripslashes(stripslashes(html_entity_decode($meta))), $field['id'], array( 'editor_class' => 'at-wysiwyg'.(isset($field['class'])? " {$field['class']}": "")) );
$settings = isset($field['wysiwyg_settings']) && is_array($field['wysiwyg_settings']) && !empty($field['wysiwyg_settings']) ? $field['wysiwyg_settings'] : array();
$settings['editor_class'] = 'at-wysiwyg'.(isset($field['class'])? " {$field['class']}": "");

wp_editor(
stripslashes(stripslashes(html_entity_decode($meta))),
$field['id'],
$settings
);
}
$this->show_field_end( $field, $meta );
}
Expand Down Expand Up @@ -2549,7 +2556,7 @@ public function addTypo($id,$args,$repeater=false){
* 'std' => // default value, string optional
* 'style' => // custom style for field, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addText($id,$args,$repeater=false){
$new_field = array('type' => 'text','id'=> $id,'std' => '','desc' => '','style' =>'','name' => 'Text Field');
Expand All @@ -2573,7 +2580,7 @@ public function addText($id,$args,$repeater=false){
* 'std' => // default value, string optional
* 'style' => // custom style for field, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addPlupload($id,$args,$repeater=false){
$new_field = array('type' => 'plupload','id'=> $id,'std' => '','desc' => '','style' =>'','name' => 'PlUpload Field','width' => null, 'height' => null,'multiple' => false);
Expand All @@ -2597,7 +2604,7 @@ public function addPlupload($id,$args,$repeater=false){
* 'std' => // default value, string optional
* 'style' => // custom style for field, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addHidden($id,$args,$repeater=false){
$new_field = array('type' => 'hidden','id'=> $id,'std' => '','desc' => '','style' =>'','name' => '');
Expand All @@ -2622,7 +2629,7 @@ public function addHidden($id,$args,$repeater=false){
* 'style' => // custom style for field, string optional
* 'syntax' => // syntax language to use in editor (php,javascript,css,html)
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addCode($id,$args,$repeater=false){
$new_field = array('type' => 'code','id'=> $id,'std' => '','desc' => '','style' =>'','name' => 'Code Editor Field','syntax' => 'php', 'theme' => 'default');
Expand All @@ -2641,7 +2648,7 @@ public function addCode($id,$args,$repeater=false){
* @access public
*
* @param $p paragraph html
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addParagraph($p,$repeater=false){
$new_field = array('type' => 'paragraph','id'=> '','value' => $p);
Expand All @@ -2663,7 +2670,7 @@ public function addParagraph($p,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addCheckbox($id,$args,$repeater=false){
$new_field = array('type' => 'checkbox','id'=> $id,'std' => '','desc' => '','style' =>'','name' => 'Checkbox Field');
Expand All @@ -2687,7 +2694,7 @@ public function addCheckbox($id,$args,$repeater=false){
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* 'fields' => list of fields to show conditionally.
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addCondition($id,$args,$repeater=false){
$new_field = array('type' => 'cond','id'=> $id,'std' => '','desc' => '','style' =>'','name' => 'Conditional Field','fields' => array());
Expand All @@ -2711,7 +2718,7 @@ public function addCondition($id,$args,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*
* @return : remember to call: $checkbox_list = get_post_meta(get_the_ID(), 'meta_name', false);
* which means the last param as false to get the values in an array
Expand All @@ -2738,7 +2745,7 @@ public function addCheckboxList($id,$options=array(),$args,$repeater=false){
* 'std' => // default value, string optional
* 'style' => // custom style for field, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addTextarea($id,$args,$repeater=false){
$new_field = array('type' => 'textarea','id'=> $id,'std' => '','desc' => '','style' =>'','name' => 'Textarea Field');
Expand All @@ -2763,7 +2770,7 @@ public function addTextarea($id,$args,$repeater=false){
* 'std' => // default value, (array) optional
* 'multiple' => // select multiple values, optional. Default is false.
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addSelect($id,$options,$args,$repeater=false){
$new_field = array('type' => 'select','id'=> $id,'std' => array(),'desc' => '','style' =>'','name' => 'Select Field','multiple' => false,'options' => $options);
Expand All @@ -2787,7 +2794,7 @@ public function addSelect($id,$options,$args,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, (array) optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addSortable($id,$options,$args,$repeater=false){
$new_field = array('type' => 'sortable','id'=> $id,'std' => array(),'desc' => '','style' =>'','name' => 'Select Field','multiple' => false,'options' => $options);
Expand All @@ -2812,7 +2819,7 @@ public function addSortable($id,$options,$args,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addRadio($id,$options,$args,$repeater=false){
$new_field = array('type' => 'radio','id'=> $id,'std' => array(),'desc' => '','style' =>'','name' => 'Radio Field','options' => $options,'multiple' => false);
Expand All @@ -2836,7 +2843,7 @@ public function addRadio($id,$options,$args,$repeater=false){
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* 'format' => // date format, default yy-mm-dd. Optional. Default "'d MM, yy'" See more formats here: http://goo.gl/Wcwxn
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addDate($id,$args,$repeater=false){
$new_field = array('type' => 'date','id'=> $id,'std' => '','desc' => '','format'=>'d MM, yy','name' => 'Date Field');
Expand All @@ -2860,7 +2867,7 @@ public function addDate($id,$args,$repeater=false){
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* 'format' => // time format, default hh:mm. Optional. See more formats here: http://goo.gl/83woX
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addTime($id,$args,$repeater=false){
$new_field = array('type' => 'time','id'=> $id,'std' => '','desc' => '','format'=>'hh:mm','name' => 'Time Field');
Expand All @@ -2883,7 +2890,7 @@ public function addTime($id,$args,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addColor($id,$args,$repeater=false){
$new_field = array('type' => 'color','id'=> $id,'std' => '','desc' => '','name' => 'ColorPicker Field');
Expand All @@ -2905,7 +2912,7 @@ public function addColor($id,$args,$repeater=false){
* 'name' => // field name/label string optional
* 'desc' => // field description, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addImage($id,$args,$repeater=false){
$new_field = array('type' => 'image','id'=> $id,'desc' => '','name' => 'Image Field');
Expand All @@ -2930,7 +2937,7 @@ public function addImage($id,$args,$repeater=false){
* 'std' => // default value, string optional
* 'style' => // custom style for field, string optional Default 'width: 300px; height: 400px'
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addWysiwyg($id,$args,$repeater=false){
$new_field = array('type' => 'wysiwyg','id'=> $id,'std' => '','desc' => '','style' =>'width: 300px; height: 400px','name' => 'WYSIWYG Editor Field');
Expand All @@ -2957,7 +2964,7 @@ public function addWysiwyg($id,$args,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addTaxonomy($id,$options,$args,$repeater=false){
$temp = array('taxonomy'=> 'category','type' => 'select','args'=> array('hide_empty' => 0));
Expand All @@ -2984,7 +2991,7 @@ public function addTaxonomy($id,$options,$args,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addRoles($id,$options,$args,$repeater=false){
$options = array_merge(array('type'=>'select'),$options);
Expand Down Expand Up @@ -3012,7 +3019,7 @@ public function addRoles($id,$options,$args,$repeater=false){
* 'desc' => // field description, string optional
* 'std' => // default value, string optional
* 'validate_func' => // validate function, string optional
* @param $repeater bool is this a field inside a repeatr? true|false(default)
* @param $repeater bool is this a field inside a repeater? true|false(default)
*/
public function addPosts($id,$options,$args,$repeater=false){
$temp = array('type'=>'select','args'=>array('posts_per_page' => -1,'post_type' =>'post'));
Expand Down