Notifications
Clear all

wpForo 1.x.x [Closed] Change, edit, delete things in "profile --> account" form..., its possible?

24 Posts
3 Users
5 Reactions
3,184 Views
Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago
Posted by: @jesus

1 - can I take off "the website field"?

2 - I can still see the social media in THEIR account profile. Are you sure it's off? (See attached pict)

Could you please show a screenshot where I can see what code do you use and where?

Jesus
Posts: 287
Topic starter
(@jesus)
Reputable Member
Joined: 4 years ago

Thanks Robert

I have this code: in the active child theme of my website in functions.php

*I have now, from yesterday. a code snipet. Should I perhaps delete the code and adding it using the code snipet? But this should not make any differences, correct?

<?php

function my_et_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_script( 'divi', get_stylesheet_directory_uri() . '/js/scripts.js', array( 'jquery', 'divi-custom-script' ), '0.1.1', true );
}
add_action( 'wp_enqueue_scripts', 'my_et_enqueue_styles' );

/* === Add your own functions below this line ===
* -------------------------------------------- */

// Create the new widget area
function myprefix_widget_area() {
register_sidebar(array(
'name' => 'Header',
'id' => 'myprefix-widget-area',
'before_widget' => '<div id="%1$s" class="et_pb_widget %2$s">',
'after_widget' => '</div> <!-- end .et_pb_widget -->',
'before_title' => '<h4 class="widgettitle">',
'after_title' => '</h4>',
));
}
add_action('widgets_init', 'myprefix_widget_area');

// Create the widget area and then move into place
function myprefix_footer() { ?>
<div id="myprefix-widget-area-wrap">
<?php dynamic_sidebar('myprefix-widget-area'); ?>
</div>
<script>
jQuery(function($){
$("#et-top-navigation").after($("#myprefix-widget-area-wrap"));
$("#myprefix-widget-area-wrap").show();
});
</script>
<?php
}
add_action('wp_footer', 'myprefix_footer');

// Adjust the layout so that it fits into the header better
function myprefix_css() { ?>
<style>
#myprefix-widget-area-wrap {
display:none;
float:right;
max-width: 500px;
clear:right;
position:relative;
}
#myprefix-widget-area-wrap .et_pb_widget { margin-right:0px }
#myprefix-widget-area-wrap .et_pb_widget:last-child { margin-bottom: 18px; }
.et-fixed-header #myprefix-widget-area-wrap .et_pb_widget:last-child { margin-bottom: 10px; }
@media only screen and ( max-width: 980px ) {
#myprefix-widget-area-wrap .et_pb_widget:last-child { margin-bottom: 0px; }
}
@media only screen and ( max-width: 768px ) {
#myprefix-widget-area-wrap .et_pb_widget:first-child { margin-top: 18px; }
}
</style>
<?php
}
add_action('wp_head', 'myprefix_css');

// Quitar redes sociales del foro
function my_custom_account_fields( $fields ){
$remove_fields = array('facebook', 'gtalk', 'aim', 'msn', 'twitter', 'yahoo', 'icq', 'skype');
if( !empty($fields) ){
foreach( $fields as $r => $rows ){
foreach( $rows as $c => $cols ){
foreach( $cols as $f => $field ){
if( wpfval($field, 'name') && in_array($field['name'], $remove_fields) ){
unset($fields[$r][$c][$f]);
}
}
}
}
}
return $fields;
}
add_filter( 'wpforo_get_account_fields', 'my_custom_account_fields');

?>

1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10587

@jesus,

Ok, thank you. Please remove this part:

// Quitar redes sociales del foro
function my_custom_account_fields( $fields ){
$remove_fields = array('facebook', 'gtalk', 'aim', 'msn', 'twitter', 'yahoo', 'icq', 'skype');
if( !empty($fields) ){
foreach( $fields as $r => $rows ){
foreach( $rows as $c => $cols ){
foreach( $cols as $f => $field ){
if( wpfval($field, 'name') && in_array($field['name'], $remove_fields) ){
unset($fields[$r][$c][$f]);
}
}
}
}
}
return $fields;
}
add_filter( 'wpforo_get_account_fields', 'my_custom_account_fields');

 

And insert this code:

function my_custom_account_fields( $fields ){
$remove_fields = array('facebook', 'gtalk', 'aim', 'msn', 'twitter', 'yahoo', 'icq', 'skype');
if( !empty($fields) ){
foreach( $fields as $r => $rows ){
foreach( $rows as $c => $cols ){
foreach( $cols as $f => $field ){
if( $field && in_array($field, $remove_fields) ){
unset($fields[$r][$c][$f]);
}
}
}
}
}
return $fields;
}
add_filter( 'wpforo_get_account_fields', 'my_custom_account_fields');
Jesus
Posts: 287
Topic starter
(@jesus)
Reputable Member
Joined: 4 years ago

YES!, that sort it inmediately Robert, Thanks very much 🙂

Do you know if the website address can be taken off too?

Thanks again 🙂

1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10587

@jesus,

you can add any field in the $remove_fields variable, with single quotes and separated by comma:

$remove_fields = array('facebook', 'gtalk', 'aim', 'msn', 'twitter', 'yahoo', 'icq', 'skype');

 

So, I added the 'site' filed in the variable. You just need to change the line above with the line below:

$remove_fields = array('site', 'facebook', 'gtalk', 'aim', 'msn', 'twitter', 'yahoo', 'icq', 'skype');

 

 

 

Jesus
Posts: 287
Topic starter
(@jesus)
Reputable Member
Joined: 4 years ago

Done Robert, this can be mark as solved, thanks so much 🙂

Jesus
Posts: 287
Topic starter
(@jesus)
Reputable Member
Joined: 4 years ago

And just one more thing I just realise Robert BUT its not a major problem so please ONLY if cost you not trouble at all 🙂

On the "dashboard", and in the user profile, the words (just the words) "Redes sociales = Social media" still shows... 

Its there a way to remove them fully?

If there is not, I think that perhaps, on the "translations phrases", if I do CLEAR the translation of said word may stop showing at all. Could I be correct on thinking so?

Thanks 🙂

1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10587

@jesus,

Insert this CSS code in the Custom CSS Code textarea. It's located in Dashboard > Forums > Settings > Styles Tab. Save it, delete all caches and check:

#wpforo #wpforo-wrap .wpforo-profile-wrap .wpforo-profile-home .wpf-field.wpf-field-name-html_soc_net, #wpforo #wpforo-wrap .wpforo-profile-account .wpf-td.wpf-row-html_soc_net{
     display: none;
}
Page 3 / 4