- This topic has 7 replies, 2 voices, and was last updated 4 years ago by
Steve.
-
AuthorPosts
-
-
January 25, 2018 at 6:07 pm #8695
openmicParticipantHi. I am trying to get a piklist editor form to show data pulled from another source.
This is the piklist form:
piklist(‘field’, array(
‘type’ => ‘editor’
,’label’ => __(‘Content’, ‘musik’)
,’description’ => __(‘This is a content of the artist.’, ‘musik’)
,’field’ => ‘content’
,’options’ => array (
‘wpautop’ => true,
‘media_buttons’ => true,
‘shortcode_buttons’ => true,
‘teeny’ => false,
‘dfw’ => false,
‘quicktags’ => true,
‘drag_drop_upload’ => true,
‘tinymce’ => array(
‘resize’ => false,
‘wp_autoresize_on’ => true
)
)
));
I need the Description in bold to pull it’s data from an EDD form which is as below:
$userdata[‘description’] = $values[‘user_bio’];I tried – ,’description’ => __(‘$userdata[‘description’] = $values[‘user_bio’];’, ‘musik’)
but that didn’t work and the guides just show how to use a shortcode.Any help would be appreciated,
Thank You -
January 26, 2018 at 12:44 pm #8696
openmicParticipantThought I had it but nope
I do love working with piklist even if it takes an old dog a bit longer to get it 🙂 -
January 26, 2018 at 5:29 pm #8697
SteveKeymasterIs the data from EDD already saved to the db? If so, where?
-
January 26, 2018 at 7:46 pm #8703
openmicParticipantYes it is – usermeta = description
I initially thought that the piklist field would pick it up as Description but it isn’t -
January 26, 2018 at 8:07 pm #8704
SteveKeymasterAnd where is the editor field displaying? On the user page? Post page?
-
January 27, 2018 at 6:59 am #8706
openmicParticipantThe user_bio displays on the EDD user dashboard.
-
January 27, 2018 at 9:34 am #8707
openmicParticipantThis is the Front end render code –
/** Returns the User_Bio to render a field in frontend */
public function render_field_frontend( $user_id = -2, $readonly = -2 ) {
if ( $user_id === -2 ) {
$user_id = get_current_user_id();
}if ( $readonly === -2 ) {
$readonly = $this->readonly;
}
$user_id = apply_filters( ‘fes_render_user_bio_user_id_frontend’, $user_id, $this->id );
$readonly = apply_filters( ‘fes_render_user_bio_readonly_frontend’, $readonly, $user_id, $this->id );
$value = $this->get_field_value_frontend( $this->save_id, $user_id, $readonly );
$required = $this->required( $readonly );
$req_class = $required ? ‘required’ : ‘rich-editor’;$output = ”;
$output .= sprintf( ‘<fieldset class=”fes-el %1s %2s %3s”>’, $this->template(), $this->name(), $this->css() );
$output .= $this->label( $readonly );
$rows = isset( $this->characteristics[‘rows’] ) ? $this->characteristics[‘rows’] : 8;
$cols = isset( $this->characteristics[‘cols’] ) ? $this->characteristics[‘cols’] : 50;
ob_start(); ?>
<div class=”fes-fields”>
<?php
if ( isset( $this->characteristics[‘rich’] ) && $this->characteristics[‘rich’] == ‘yes’ ) {
$options = array( ‘editor_height’ => $rows, ‘quicktags’ => false, ‘editor_class’ => $req_class );
wp_editor( $value, $this->name(), $options );} elseif ( isset( $this->characteristics[‘rich’] ) && $this->characteristics[‘rich’] == ‘teeny’ ) {
$options = array( ‘editor_height’ => $rows, ‘quicktags’ => false, ‘teeny’ => true, ‘editor_class’ => $req_class );
wp_editor( $value, $this->name(), $options );
} else { ?>
<textarea class=”textareafield<?php echo $this->required_class( $readonly ); ?>” id=”<?php echo $this->name(); ?>” name=”<?php echo $this->name(); ?>” data-required=”<?php echo $required; ?>” data-type=”textarea”<?php $this->required_html5( $readonly ); ?> placeholder=”<?php echo esc_attr( $this->placeholder() ); ?>” rows=”<?php echo esc_attr( $rows ); ?>” cols=”<?php echo esc_attr( $cols ); ?>”><?php echo esc_textarea( $value ) ?></textarea>
<?php } ?>
</div>
<?php
$output .= ob_get_clean();
$output .= ‘</fieldset>’;
return $output;
} -
January 30, 2018 at 5:27 pm #8709
SteveKeymasterI’m still not 100% clear what you are trying to do, but in the Piklist demos we have an example of displaying a user’s profile in a front end form.
-
-
AuthorPosts
- You must be logged in to reply to this topic.