Angelo Rocha
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Set theme mod after switch themeI close this thread and open in another forum?
- This reply was modified 3 years, 10 months ago by Angelo Rocha.
Forum: Plugins
In reply to: [Redux Framework] Translate on custom option page not workWork fine. Thanks.
Forum: Plugins
In reply to: [Redux Framework] Multi text field problemCan Redux 4 already be used for production sites?
I’m using redux 3 =OForum: Plugins
In reply to: [Redux Framework] Translate on custom option page not workThank you, i wait while i try to resolve too.
Good vacation.Forum: Plugins
In reply to: [Redux Framework] Translate on custom option page not workI saw the documentation, I’m doing it this way, but it doesn’t work, the string doesn’t translate.
This is my code, where am i wrong?
https://github.com/angelorocha/superstar/blob/master/theme-options/options/theme_options.phpSorry for my bad english =)
Thanks for help- This reply was modified 4 years, 3 months ago by Angelo Rocha.
Forum: Plugins
In reply to: [CMB2] Sanitize custom field checkbox optionMy solution, this is not best solution, but solved =(
Sanitize checkbox:
if ( empty($val['required']) ): unset( $val['required'] ); $val['required'] = 'off'; else: $val['required'] = 'on'; endif;
In my js:
jQuery(function ($){ $(".form_field_required input[type='checkbox']").each(function (){ if($(this).val() !== 'on'){ $(this).removeAttr('checked'); } }); });
Forum: Plugins
In reply to: [CMB2] Sanitize custom field checkbox optionYes:
$value = wp_parse_args( $value, array( 'id' => '', 'label' => '', 'type' => 'text', 'options' => '', 'size' => '', 'required' => 'on' // this is checkbox ) );
But when i deselect the checkbox, the field remains checked after save post.
Forum: Developing with WordPress
In reply to: Custom Widget and AjaxI did so, it works fine.
I did not like the solution XDThanks.
suggestions for improvements are welcomeForum: Developing with WordPress
In reply to: Custom Widget and AjaxThis is the version 2:
But needs improvement, see line: 22
Any idea?
Thanks!
Forum: Developing with WordPress
In reply to: Custom Widget and AjaxGot it.
I’m calling in the class constructor, after several changes, but I do not know how to pass arguments in the action, I need to still retrieve the widget ID in the class constructor, is it possible?I also need to retrieve the value of the widget method instance in the class constructor, this for me is a bit confusing.
Thanks for the help.
Forum: Plugins
In reply to: [CMB2] Custom field type vs Repeatable attrI try add a “checkbox” field in this code, but the after save data, the value don’t change.
Any idea?My code, line 96: https://pastebin.com/jWV3EBZK
Forum: Plugins
In reply to: [CMB2] Custom field type vs Repeatable attrVery thanks Michael, sorry for the delay.
Justin, thanks for this tip.
Problem solved.
Forum: Plugins
In reply to: [CMB2] Custom field type vs Repeatable attrMy custom field code:
function cmb2_field_type_options( $value = false ) { $type_list = array( 'text' => 'Texto', 'mail' => 'Email', 'money' => 'Dinheiro', 'date' => 'Data', ); $field_types = ''; foreach ( $type_list as $key => $type ): $field_types .= "<option value='$key' " . selected( $value, $key, false ) . ">$type</option>"; endforeach; return $field_types; } add_filter( 'cmb2_render_formfield', 'cmb2_render_formfield_callback', 10, 5 ); function cmb2_render_formfield_callback( $field, $value, $object_id, $object_type, $field_type ) { $value = wp_parse_args( $value = array( 'field_id' => '', 'field_label' => '', 'field_type' => '', 'field_size' => '', ) ); ?> <table> <tr> <td> <label for="<?php echo $field_type->_id( '_field_id' ) ?>">ID do Campo</label> <?php echo $field_type->input( array( 'name' => $field_type->_name( '[field_id]' ), 'id' => $field_type->_id( '_field_id' ), 'value' => $value['field_id'], 'desc' => '' ) ) ?> </td> <td> <label for="<?php echo $field_type->_id( '_field_label' ) ?>">Título do campo</label> <?php echo $field_type->input( array( 'name' => $field_type->_name( '[field_label]' ), 'id' => $field_type->_id( '_field_label' ), 'value' => $value['field_label'], 'desc' => '' ) ) ?> </td> <td> <label for="<?php echo $field_type->_id( '_field_type' ) ?>">Tipo do campo</label> <?php echo $field_type->select( array( 'name' => $field_type->_name( '[field_type]' ), 'id' => $field_type->_id( '_field_type' ), 'options' => cmb2_field_type_options( $value['field_type'] ), 'desc' => '' ) ) ?> </td> <td> <label for="<?php echo $field_type->_id( '_field_size' ) ?>">Tamanho do campo</label> <?php echo $field_type->input( array( 'name' => $field_type->_name( '[field_size]' ), 'id' => $field_type->_id( '_field_size' ), 'value' => $value['field_size'], 'desc' => '' ) ) ?> </td> </tr> </table> <?php }
My call:
$form->add_field( array( 'name' => 'Campos', 'desc' => 'Adiciona campos ao formulário', 'id' => '_form_fields', 'type' => 'formfield', 'repeatable' => true, 'text' => array( 'add_row_text' => 'Adicionar Campo', ), ) );
Thanks Michael
Forum: Plugins
In reply to: [CMB2] Custom field type vs Repeatable attrSorry, sorry…
https://github.com/CMB2/CMB2/issues/116Forum: Plugins
In reply to: [FeedWordPress] FeedWordPress auto thumbnail and image grab