Snippets
Stop the latin chars to work when the users register
Use this code at the child theme in the functions.php file
add_filter("wpqa_sanitize_username","discy_child_sanitize_username",1,2);
function wpqa_sanitize_username ($username,$o_username) {
return $o_username;
}
add_filter("wpqa_sanitize_username","discy_child_sanitize_username",1,2);
function wpqa_sanitize_username ($username,$o_username) {
return $o_username;
}
Use thumbs for your vote
Use this code at the child theme in the functions.php file
add_filter("wpqa_vote_up_icon","wpqa_vote_up_icon");
function wpqa_vote_up_icon($icon) {
return "icon-thumbs-up";
}
add_filter("wpqa_vote_down_icon","wpqa_vote_down_icon");
function wpqa_vote_down_icon($icon) {
return "icon-thumbs-down";
}
Or if you want to use the fontawesome
add_filter("wpqa_vote_up_icon","wpqa_vote_up_icon");
function wpqa_vote_up_icon($icon) {
return "far fa-thumbs-up";
}
add_filter("wpqa_vote_down_icon","wpqa_vote_down_icon");
function wpqa_vote_down_icon($icon) {
return "far fa-thumbs-down";
}
add_filter("wpqa_vote_up_icon","wpqa_vote_up_icon");
function wpqa_vote_up_icon($icon) {
return "icon-thumbs-up";
}
add_filter("wpqa_vote_down_icon","wpqa_vote_down_icon");
function wpqa_vote_down_icon($icon) {
return "icon-thumbs-down";
}
Or if you want to use the fontawesome
add_filter("wpqa_vote_up_icon","wpqa_vote_up_icon");
function wpqa_vote_up_icon($icon) {
return "far fa-thumbs-up";
}
add_filter("wpqa_vote_down_icon","wpqa_vote_down_icon");
function wpqa_vote_down_icon($icon) {
return "far fa-thumbs-down";
}
Use avatar from the social for the Oneall plugin
Use this code at the child theme in the functions.php file
add_filter("wpqa_filter_avatar_image","discy_child_avatar_image",1,4);
function discy_child_avatar_image ($avatar,$user_meta_avatar,$you_avatar,$user_id) {
$social_thumbnail = get_user_meta($user_id,"oa_social_login_user_picture",true);
$avatar = ($social_thumbnail != ""?$social_thumbnail:$avatar);
return $avatar;
}
add_filter("wpqa_filter_avatar_image","discy_child_avatar_image",1,4);
function discy_child_avatar_image ($avatar,$user_meta_avatar,$you_avatar,$user_id) {
$social_thumbnail = get_user_meta($user_id,"oa_social_login_user_picture",true);
$avatar = ($social_thumbnail != ""?$social_thumbnail:$avatar);
return $avatar;
}
Use avatar from the social for the Nextend Social Login plugin
Use this code at the child theme in the functions.php file
add_filter("wpqa_user_meta_avatar","wpqa_user_meta_avatar");
function wpqa_user_meta_avatar() {
global $wpdb,$blog_id;
return $wpdb->get_blog_prefix($blog_id).'user_avatar';
}
add_filter("wpqa_user_meta_avatar","wpqa_user_meta_avatar");
function wpqa_user_meta_avatar() {
global $wpdb,$blog_id;
return $wpdb->get_blog_prefix($blog_id).'user_avatar';
}
Use avatar from the social for the AccessPress Social Login Lite plugin
Use this code at the child theme in the functions.php file
add_filter("wpqa_filter_avatar_image","discy_child_avatar_image",1,4);
function discy_child_avatar_image ($avatar,$user_meta_avatar,$you_avatar,$user_id) {
$social_thumbnail = get_user_meta($user_id,"deuimage",true);
$avatar = ($social_thumbnail != ""?$social_thumbnail:$avatar);
return $avatar;
}
add_filter("wpqa_filter_avatar_image","discy_child_avatar_image",1,4);
function discy_child_avatar_image ($avatar,$user_meta_avatar,$you_avatar,$user_id) {
$social_thumbnail = get_user_meta($user_id,"deuimage",true);
$avatar = ($social_thumbnail != ""?$social_thumbnail:$avatar);
return $avatar;
}
Add any shortcode to login/signup for social media login.
Use this code at the child theme in the functions.php file
add_filter("wpqa_filter_social_login","discy_child_social_login");
function discy_child_social_login() {
return do_shortcode("[nextend_social_login];
}
add_filter("wpqa_filter_social_login","discy_child_social_login");
function discy_child_social_login() {
return do_shortcode("[nextend_social_login];
}
Change the header color
Use this code at the child theme in the style.css file
.header {
background-color: #F00 !important;
}
.header {
background-color: #F00 !important;
}
Change the footer color
Use this code at the child theme in the style.css file
.footer {
background-color: #F00 !important;
}
.footer {
background-color: #F00 !important;
}
Remove some buttons from the editor
Use this code at the child theme in the functions.php file
add_filter("wpqa_question_editor_setting","wpqa_editor_setting");
add_filter("wpqa_post_editor_setting","wpqa_editor_setting");
add_filter("wpqa_comment_editor_setting","wpqa_editor_setting");
add_filter("wpqa_description_editor_setting","wpqa_editor_setting");
add_filter("wpqa_message_editor_setting","wpqa_editor_setting");
function wpqa_editor_setting() {
return array("textarea_name" => "comment","media_buttons" => true,"textarea_rows" => 10,"quicktags" => false,'tinymce' => array(
'toolbar1' => 'bold,italic,underline,separator,alignleft,aligncenter,alignright,separator,link,unlink,undo,redo','toolbar2' => '','toolbar3' => ''));
}
add_filter("wpqa_question_editor_setting","wpqa_editor_setting");
add_filter("wpqa_post_editor_setting","wpqa_editor_setting");
add_filter("wpqa_comment_editor_setting","wpqa_editor_setting");
add_filter("wpqa_description_editor_setting","wpqa_editor_setting");
add_filter("wpqa_message_editor_setting","wpqa_editor_setting");
function wpqa_editor_setting() {
return array("textarea_name" => "comment","media_buttons" => true,"textarea_rows" => 10,"quicktags" => false,'tinymce' => array(
'toolbar1' => 'bold,italic,underline,separator,alignleft,aligncenter,alignright,separator,link,unlink,undo,redo','toolbar2' => '','toolbar3' => ''));
}
Add custom countries
Use this code at the child theme in the functions.php file
add_filter('wpqa_get_countries','discy_child_get_countries');
function discy_child_get_countries() {
$countries = array(
'DZ' => esc_html__( 'Algeria', 'wpqa' ),
'BH' => esc_html__( 'Bahrain', 'wpqa' ),
'EG' => esc_html__( 'Egypt', 'wpqa' ),
'YE' => esc_html__( 'Yemen', 'wpqa' ),
'IQ' => esc_html__( 'Iraq', 'wpqa' ),
'KW' => esc_html__( 'Kuwait', 'wpqa' ),
'LB' => esc_html__( 'Lebanon', 'wpqa' ),
'LY' => esc_html__( 'Libya', 'wpqa' ),
'MA' => esc_html__( 'Morocco', 'wpqa' ),
'OM' => esc_html__( 'Oman', 'wpqa' ),
'QA' => esc_html__( 'Qatar', 'wpqa' ),
'SA' => esc_html__( 'Saudi Arabia', 'wpqa' ),
'SD' => esc_html__( 'Sudan', 'wpqa' ),
'SY' => esc_html__( 'Syria', 'wpqa' ),
'TN' => esc_html__( 'Tunisia', 'wpqa' ),
'TR' => esc_html__( 'Turkey', 'wpqa' ),
'AE' => esc_html__( 'United Arab Emirates', 'wpqa' ),
);
asort($countries);
return $countries;
}
add_filter('wpqa_get_countries','discy_child_get_countries');
function discy_child_get_countries() {
$countries = array(
'DZ' => esc_html__( 'Algeria', 'wpqa' ),
'BH' => esc_html__( 'Bahrain', 'wpqa' ),
'EG' => esc_html__( 'Egypt', 'wpqa' ),
'YE' => esc_html__( 'Yemen', 'wpqa' ),
'IQ' => esc_html__( 'Iraq', 'wpqa' ),
'KW' => esc_html__( 'Kuwait', 'wpqa' ),
'LB' => esc_html__( 'Lebanon', 'wpqa' ),
'LY' => esc_html__( 'Libya', 'wpqa' ),
'MA' => esc_html__( 'Morocco', 'wpqa' ),
'OM' => esc_html__( 'Oman', 'wpqa' ),
'QA' => esc_html__( 'Qatar', 'wpqa' ),
'SA' => esc_html__( 'Saudi Arabia', 'wpqa' ),
'SD' => esc_html__( 'Sudan', 'wpqa' ),
'SY' => esc_html__( 'Syria', 'wpqa' ),
'TN' => esc_html__( 'Tunisia', 'wpqa' ),
'TR' => esc_html__( 'Turkey', 'wpqa' ),
'AE' => esc_html__( 'United Arab Emirates', 'wpqa' ),
);
asort($countries);
return $countries;
}
Stop popup for sign in or sign up
Use this code at the child theme in the functions.php file
add_filter("wpqa_pop_up_class_signup","wpqa_pop_up_class");
add_filter("wpqa_pop_up_class_login","wpqa_pop_up_class");
function wpqa_pop_up_class($class) {
return " wpqa-not-pop";
}
add_filter("wpqa_pop_up_class_signup","wpqa_pop_up_class");
add_filter("wpqa_pop_up_class_login","wpqa_pop_up_class");
function wpqa_pop_up_class($class) {
return " wpqa-not-pop";
}
Add custom currencies
Use this code at the child theme in the functions.php file
add_filter("wpqa_currencies","discy_child_currencies");
function discy_child_currencies($currencies) {
return array(
'PLN' => 'PLN',
'TL' => 'TL'
);
}
add_filter("wpqa_currencies","discy_child_currencies");
function discy_child_currencies($currencies) {
return array(
'PLN' => 'PLN',
'TL' => 'TL'
);
}