h4m3d99
Forum Replies Created
-
if you take it out of that code, does everything work?
– Yes, when I remove user_is_vendor() no bug write in debug.php. How can I contact you privately? (Like email)
if you swap to twenty-sixteen does it go away?
– Yes
Hi.
I dont think is_user_logged_in() is the culprit, since that function only returns true or false.
You must be using that in if clause, and the culprit might be in the block.
Can you provide your code here?Hi ikaring,
I agree with you. is_user_logged_in() is not the culprit. When I remove that, some components from header gone. My code:<?php if( is_user_logged_in() && user_is_vendor() ) { ..... } ?>And user_is_vendor():
<?php function user_is_vendor( $user = -2 ){ if ( $user === -2 ) { $user = get_current_user_id(); } if ( $user == 0 ) { // This is a logged out user, since get_current_user_id returns 0 for non logged in // since we can't do anything with them, lets get them out of here. They aren't vendors. return false; } if ( is_numeric( $user ) ) { $field = 'user_id'; } else if ( is_email( $user ) ) { $field = 'email'; } else { $field = 'username'; } $db = new FES_DB_Vendors; $vendor = $db->get_vendor_by( $field, $user ); if ( empty( $vendor ) || ! is_object( $vendor ) ) { return false; } else { $output = false; if ( $vendor->status === 'approved' ) { $output = true; } $output = apply_filters( 'fes_vendors_user_is_vendor', $output, $vendor, $user ); return $output; } } ?>I disable all plugins but the problem remains.
what makes you think that? where did you pick this piece of code from?
Actually, When I remove this function from header.php; Everything works properly.
Really strange!Thanks for your reply juggledad.
I think it’s about a function that related to is_user_logged_in().Forum: Fixing WordPress
In reply to: How to create sub-taxonomies ?Solve it!
<?php wp_insert_term( $term, $taxonomy, $args = array() ); ?>Forum: Fixing WordPress
In reply to: How to create sub-taxonomies ?