Skip to content

Instantly share code, notes, and snippets.

@temperatio
Created June 19, 2020 15:31
Show Gist options
  • Save temperatio/d86b4fe2786338a397f1da7c3dab7041 to your computer and use it in GitHub Desktop.
Save temperatio/d86b4fe2786338a397f1da7c3dab7041 to your computer and use it in GitHub Desktop.
[Change restricted post message] #wordpress #woocommerce #membership
<?php // only copy this if needed
/**
* Changes excerpts displayed on restricted membership content to use 120 words
* instead of WordPress default.
*
* @since 1.6.0
* @param string $content HTML content displayed for the post
* @param bool $restricted Whether the content is restricted
* @param string $message The restriction message applied, could be empty string
* @param \WP_Post $post The post being restricted
* @return string – the updated restricted content HTML
*
* Requires v1.10.1+ of Memberships
*/
function filter_wc_memberships_the_restricted_content($content, $restricted, $message, $post) {
return $content;
}
add_filter( 'wc_memberships_the_restricted_content', 'filter_wc_memberships_the_restricted_content' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment