id ) ) { return; } $field = $this->extra; $field['id'] = $this->id; $field['default'] = $this->default; $field['description'] = $this->description; $field['label'] = $this->label; $field['placeholder'] = isset( $field['placeholder'] ) ? $field['placeholder'] : ''; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'short'; $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['default'] = ( ! $this->meta_value( $thepostid ) && isset( $field['default'] ) ) ? $field['default'] : $this->meta_value( $thepostid ); $field['value'] = isset( $field['value'] ) ? $field['value'] : $field['default']; $field['desc_tip'] = isset( $field['desc_tip'] ) ? $field['desc_tip'] : false; $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; // Custom attribute handling $custom_attributes = array(); if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) { foreach ( $field['custom_attributes'] as $attribute => $custom_attribute ) { $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $custom_attribute ) . '"'; } } echo '

'; echo ' '; if ( ! empty( $field['description'] ) ) { echo '' . wp_kses_post( $field['description'] ) . ''; if ( ! empty( $field['desc_tip'] ) ) { learn_press_quick_tip( $field['desc_tip'] ); } } echo '

'; } public function save( $post_id ) { $value = ! empty( $_POST[ $this->id ] ) ? wp_kses_post( wp_unslash( $_POST[ $this->id ] ) ) : ''; update_post_meta( $post_id, $this->id, $value ); } }