Restrict Content Pro
rcp_messages_settings
Coming soon: Restrict Content Pro is becoming Kadence Memberships. You may see both names used while we update the product, documentation, and customer experience.
Note: This content is provided as a resource within our developer documentation. Because custom code requires highly specific implementation, we encourage you to work with a qualified developer if you need guidance. You can find our recommended consultants here: https://codeable.io/developers/restrict-content-pro/
Used to add additional options below the message settings in Restrict → Settings → General (below Restricted Content Message).
Parameters$rcp_options – Array of Restrict Content Pro settings.
Example
/**
* Add a custom field to Restrict → Settings → General, below Restricted Content Message.
*
* @param array $rcp_options Restrict Content Pro settings.
*/
function ag_rcp_messages_settings( $rcp_options ) {
$value = isset( $rcp_options['your_custom_setting'] ) ? $rcp_options['your_custom_setting'] : '';
?>
<tr valign="top">
<th>
<label for="rcp_settings[your_custom_setting]"><?php esc_html_e( 'Your Custom Setting', 'rcp' ); ?></label>
</th>
<td>
<input
class="regular-text"
id="rcp_settings[your_custom_setting]"
name="rcp_settings[your_custom_setting]"
type="text"
value="<?php echo esc_attr( $value ); ?>"
/>
<p class="description"><?php esc_html_e( 'Your description goes here.', 'rcp' ); ?></p>
</td>
</tr>
<?php
}
add_action( 'rcp_messages_settings', 'ag_rcp_messages_settings' );
The input name must stay rcp_settings[your_key] so Restrict Content Pro saves it with the other general settings.