Disable or Enable Text Selection

You can use the following filters for enabling or disabling Highlight and Share for certain posts or pages:

  • has_enable_content (returns a boolean)

  • has_enable_excerpt (returns a boolean)

You can use the above filters to show or hide Highlight and Share text selection on certain pages.

For example, to exclude Highlight and Share from an About page, you could do the following:

add_filter(
	'has_enable_content',
	function( $load_content ) {
		if ( is_page( 'highlight-and-share' ) ) {
			return false;
		}
		return $load_content;
	}
);

Last updated