I found a solution. I undid the previous setting, regaining the phone retrieval. Despite i see on the backend my user phone, the wau i had to do to retrieve the phone FROM THE ACTUAL AUTHOR is the following in the single-advert:
$user_id = get_post( $post_id )->post_author;
$args = array(
'author' => $user_id,
'post_type' => 'advert-author',
'post_status' => array( 'publish', 'advert-hidden' ),
'posts_per_page' => 1
$username_author = $author_id = $authors[0]->post_title;
$username_alias = $author_id = $authors[0]->post_name;
$username_phone = $author_id = $authors[0]->user_phone;
and then in functions.php the function that calls that segment of the form :
function inside_contact_form( $post_id ) {
include_once ADVERTS_PATH . 'includes/class-form.php';
include_once ADVERTS_PATH . 'includes/class-html.php';
$show_form = false;
$flash = array( "error" => array(), "info" => array());;
$email = get_post_meta( $post_id, "adverts_email", true );
$phone = get_post_meta( $post_id, "adverts_phone", true );
$message = null;
$form = new Adverts_Form( Adverts::instance()->get( "form_contact_form" ) );
$actions_class = "adverts-field-actions";
$buttons = array(
array(
"tag" => "input",
"name" => "adverts_contact_form",
"type" => "submit",
"value" => __( "Send Message", "wpadverts" ),
"class" => "adverts-button",
"html" => null
),
);
if( adverts_request( "adverts_contact_form" ) ) {
wp_enqueue_script( 'adverts-contact-form-scroll' );
$form->bind( stripslashes_deep( $_POST ) );
$valid = $form->validate();
if( $valid ) {
//Adext_Contact_Form::instance()->send_message( get_post( $post_id ), $form );
do_action( "adext_contact_form_send", $post_id, $form );
$form->bind( array() );
$flash["info"][] = array(
"message" => __( "Your message has been sent.", "wpadverts" ),
"icon" => "adverts-icon-ok"
);
$show_form = true;
} else {
$flash["error"][] = array(
"message" => __( "There are errors in your form.", "wpadverts" ),
"icon" => "adverts-icon-attention-alt"
);
$show_form = true;
}
} else {
if( get_current_user_id() > 0 ) {
$user = wp_get_current_user();
/* @var $user WP_User */
$bind = array(
"message_name" => $user->display_name,
"message_email" => $user->user_email
);
$form->bind( $bind );
}
}
?>
<div id="adverts-contact-form-scroll"></div>
<?php if( adext_contact_form_get_to( $post_id ) ): ?>
<div class="adverts-contact-box adverts-contact-box-toggle" <?php if($show_form): ?>style="display: block"<?php endif ?>>
<?php if( adverts_config( "contact_form.show_phone") == "1" && ! empty( $phone ) ): ?>
<span class="adverts-button" style="background-color: transparent; cursor: auto">
<?php //esc_html_e( "Phone", "wpadverts" ) ?>
<span class="adverts-icon-phone"></span>
<a href="tel:<?php echo esc_html( $phone ) ?>"><?php global $username_phone;echo $username_phone; ?></a>
</span>
<?php endif; ?>
<?php adverts_flash( $flash ) ?>
<?php include apply_filters( "adverts_template_load", ADVERTS_PATH . 'templates/form.php' ) ?>
</div>
<?php endif; ?>
<?php
}
I admit that was not the cleanest solution but it will retrieve the phone from who belongs to the post.