allow web only profiles to display on website

This commit is contained in:
Evan Mullins 2022-10-26 09:56:26 -04:00
parent 9c932a8780
commit 9f6bd464cf
5 changed files with 25 additions and 9 deletions

View file

@ -581,7 +581,11 @@ function wasmo_update_user_question_count(){
$userid = $user->ID;
$tempterms['users']++;
// only use public users - so we don't end up with blank question pages
if ( 'true' === get_field( 'in_directory', 'user_' . $userid ) ) {
$in_directory = get_field( 'in_directory', 'user_' . $userid );
if (
'true' === $in_directory ||
'website' === $in_directory
) {
// get questions for user
if( have_rows( 'questions', 'user_' . $userid ) ) {

View file

@ -5,7 +5,7 @@
Author: Evan Mullins
Author URI: https://circlecube.com
Template: twentynineteen
Version: 1.9.20
Version: 1.9.21
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wasmo

View file

@ -62,8 +62,12 @@ if ( false === ( $the_answers = get_transient( $transient_name ) ) ) {
$the_answers .= '</blockquote>';
// user attribution - photo and name and link (only if they want to be listed in directory)
if ( 'true' === get_field( 'in_directory', 'user_' . $userid ) ||
'private' === get_field( 'in_directory', 'user_' . $userid ) && is_user_logged_in() ) {
$in_directory = get_field( 'in_directory', 'user_' . $userid );
if (
'true' === $in_directory ||
'website' === $in_directory ||
( 'private' === $in_directory && is_user_logged_in() )
) {
$userimg = get_field( 'photo', 'user_' . $userid );
$username = esc_html( $user->nickname );

View file

@ -63,10 +63,14 @@ if ( false === ( $the_directory = get_transient( $transient_name ) ) ) {
// only add to directory if user includes themself and has filled out the first two fields
// true = public
// private = only to a logged in user
if ( get_field( 'hi', 'user_' . $userid ) &&
$in_directory = get_field( 'in_directory', 'user_' . $userid );
if (
get_field( 'hi', 'user_' . $userid ) &&
get_field( 'tagline', 'user_' . $userid ) &&
'true' === get_field( 'in_directory', 'user_' . $userid ) ||
'private' === get_field( 'in_directory', 'user_' . $userid ) && is_user_logged_in() ) {
'true' === $in_directory ||
'website' === $in_directory ||
( 'private' === $in_directory && is_user_logged_in() )
) {
// $context contains taxonomy && user has the term selected
if ( strpos( $context, 'taxonomy' ) === 0 ) {

View file

@ -51,8 +51,12 @@ get_header();
$the_answers .= '</blockquote>';
// user attribution - photo and name and link (only if they want to be listed in directory)
if ( 'true' === get_field( 'in_directory', 'user_' . $userid ) ||
'private' === get_field( 'in_directory', 'user_' . $userid ) && is_user_logged_in() ) {
$in_directory = get_field( 'in_directory', 'user_' . $userid );
if (
'true' === $in_directory ||
'website' === $in_directory ||
( 'private' === $in_directory && is_user_logged_in() )
) {
$userimg = get_field( 'photo', 'user_' . $userid );
$username = esc_html( $user->nickname );