How to check if the user was redirected?

You can use wp_get_referer function to acheive your requirement. Below is the useful code snippet for you. function wdm_referer() { global $post; if( post type is child ) { $child_post_id = $post->ID; $parent_id = get_parent_course_id($child_post_id); // your custom function to get parent course id if( parent task is not completed ) { // a condition … Read more

Is there a way to load pages/site from specific referring source only?

My preferred option is a quick-and-dirty, though very common, solution. The vendor has a “Support” page that contains limited “public” information. However the page includes a user “sign in” option so that authorised users can access all the “private” data that you have concerning your product. This page can be accessed via the public website … Read more

Administrator cannot see private content

Private Content Private content is published only for your eyes, or the eyes of only those with authorization permission levels to see private content. Normal users and visitors will not be aware of private content. It will not appear in the article lists. If a visitor were to guess the URL for your private post, … Read more

Assign a username and password to specific users

Yes, there are several possible ways to do this. The easiest method is probably to use Basic HTTP Authentication using a .htaccess and .htpasswd file. Here’s a site that will generate these for you. You can create separate usernames/passwords and then drop these files in the private folder. There are several guides and tutorials for … Read more

Custom get_the_password_form

If you look at the source code of the get_the_content() function which retrieves the post content, you’d see the following conditional: if ( post_password_required( $post ) ) return get_the_password_form( $post ); And in the get_the_password_form() function, there’s a filter you can use to customize the HTML of the default password form: return apply_filters( ‘the_password_form’, $output … Read more

Will ‘private’ status prevent Woocommerce products to be indexed by search engines?

If you are using the default WordPress method of marking a post/page private, NO. This only prevents that post/page content from being viewable. Google (and other search bots) will not find private pages. Only logged in blog Editors and Administrators can see Private pages. So, while WordPress will not add the meta to block bots, … Read more

How to remove private posts from RSS feeds?

The same way you would change which posts WP shows on any other screen, pre_get_posts! If you ever see WP pull in posts, and want to modify what it fetches from the DB, use the pre_get_posts filter E.g. something similar to this: add_action( ‘pre_get_posts’, function( \WP_Query $query ) { if ( !$query->is_feed() ) { return; … Read more