Expert Group of programming
Loading...

WP content protection -Use by custom field (ACF feature)

Posted by : Heycode Tech | Posted in : WordPress Plugins | Aug 11,2015 | 0 comments

Here is the new feature of this plugin .Now you can use this plugin feature by advanced custom field key also. Here is the brief descriptions.

As you know that this plugin have the three protection mechanism :-

  1. LoggedIn user: Access only loggedin user.
  2. Password protection: Access only user whom have password.
  3. UserRole security: Access of user whom have some specific role.

Here is the functions name and it’s parameter.

Function name : echo wpcp_protection_with_advanced_custom_field($customfieldkey,$isloggedin,$userroles,$ispassword);


The detailed descriptions of parameter.

$customfieldkey = > ; Enter the custom field key. You can also add advanced custom field key.
 $isloggedin = > {0,1} .
Now the value ='1' is used for active the loggedin protection
mechanism i.e You need to access this content for logged in user only.
0 = Not allowed for this protection.
$userroles = > {'editor','author','0' etc} . 
You can enter the any user roles for content protection security and leave blank if you don't need to allow this feature.
$ispassword = > {'#Enter the password#'}. 
Use the password protection for entering the password value.
Note: 0 is used for leave the content protection. 0(zero) is used in any parameter.

Here is the detailed descriptions for using the functions for protecting the content

1: LoggedIn user: Access only loggedin user.
When you need for this security then you need to add the function as like :

echo wpcp_protection_with_advanced_custom_field('#Enter customfield key#','1','0','0');
Note: 0 values shows we don't need these security.


2:Password protection: Access only user whom have password.
When you need for this security then you need to add the functions as like :

echo wpcp_protection_with_advanced_custom_field('#Enter customfield key#','0','0','#enter password here#');
Suppose our password is : shank123 : and advanced custom field or custom field :myname: then
echo wpcp_protection_with_advanced_custom_field('myname','0','0','shank123');
Note: 0 values shows we don't need these security.


3:UserRole security: Access of user whom have some specific role.
When you need for this security then you need to add the functions as like :

echo wpcp_protection_with_advanced_custom_field('#Enter customfield key#','0','#enter editor roles#','0');

Suppose our user roles is :’editor’ :and advanced custom field or custom field :myname: then

echo wpcp_protection_with_advanced_custom_field('myname','0','editor','');

Note: 0 values shows we don’t need these security.

Special : Use Multiple options in one functions
Here is the way to use it :

echo wpcp_protection_with_advanced_custom_field('#Enter customfield key#','#Enter value 0 or 1#','#enter editor roles#','#enter password#');

Like : custom field key : myname : user roles : editor and password : shank123

echo wpcp_protection_with_advanced_custom_field('myname','1','editor','shank123');

For any doubt, please feel free to comment here or leave a message from contact form with subject ‘wp content protection issues’ .

You can also give the own suggestion/comment ,it’s pleasure for me.

Tags:

Author information - Heycode Tech

Every world can ask question and my website registered user give the suggestion.

See all posts by Author

Connect to author

About us

Heycodetech is a platform where you can ask any questions related to the programming like PHP,jQuery, MYSQL,HTML , CSS and moreHere is the Expert group of programming.