• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Store
    • Cart
    • Checkout
  • Blog
    • Basics [Free]
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Contact
  • Sign In
  • Show Search
Hide Search
Home » Plugins » WP-Members » Documentation » Filter and Action Hooks » wpmem_restricted_msg

wpmem_restricted_msg

Description

This filters the post restricted message dialog.

The default message string is “<p>This content is restricted to site members. If you are an existing user, please log in. New users may register below.</p>”

Note that the message text can be customized in the plugin’s dialogs tab. Also, if you are running a translated version of the plugin, this string may likely be translated. Keep those things in mind if using this hook to use str_replace on any of the dialog text since str_replace will only work on an exact match.

Usage

add_filter( 'wpmem_restricted_msg', 'my_restricted_msg' );

function my_restricted_msg( $str ) {

	/*
	 * This example replaces the default <p> tag in the message
	 * string with one containing a custom class.
	 */
	
	$str = str_replace( '<p>', '<p class="my-custom-class">', $str );

	return $str;
}

Code Snippet Library [Subscriber Content]

  • Post restricted message based on specific post/page or group
See a list of all filter and action hooks

Welcome to RocketGeek Interactive › Forums › Plugins › WP-Members › WP-Members Documentation › Filter and Action Hooks › wpmem_restricted_msg

  • This topic has 0 replies, 1 voice, and was last updated 8 years, 11 months ago by Chad Butler.
Viewing 0 reply threads
  • Author
    Posts
    • March 27, 2012 at 12:19 am #7752
      Chad Butler
      Keymaster

      Description This filters the post restricted message dialog. The default message from the plugin install is “This content is restricted to site member
      [See the full post at: wpmem_restricted_msg]

  • Author
    Posts
Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Log In

Ready to get started?

Join Today!

© 2021 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Refund Policy