How restrict some data for some users?

I need a professional advise.

I need a simple function that will block&replace some WP-WooC database widely used data (as Site Name, User Name, Taxonomies, Products Attributes, etc) from unregistered users. For example authors names will shown for unregistered users as “Register to see”. So I want to make a function that will be like a low-level filter and will work with ALL OTHER plugins by blocking&replacing chosen info for them too.

Sample methods:

  1. PHP code like: “” - will NOT work on a custom pages where it absent. So it must be added to each page? It’s not elegant for sure.

  2. “WooCoomerce hooks” seems that will NOT work with all other and custom plugins and custom pages etc outside WooCoommerce itself.

Also a working logic of both of them a pile-jumble with extra work and maybe not secure because protected info will be replaced after retrieving from DB. But I want to block this info for all Wp-WooC requests-plugins for sure!

  1. Does WP-WooC support low-level filters direct at MySQL DB? Does EACH query-select to DB have a USER_ID so it can be used for each query user right recognizing?

What method you suggest?

At #1 code was:
<?php if ( is_user_logged_in() ) { echo $123; } else { echo ‘text’; } ?>

Please, help anyone!!! :frowning: