ID, '_aisp_protected', true); // Get global protection settings $global_posts_protection = get_option('aisp_protector_enable_posts', false); $global_pages_protection = get_option('aisp_protector_enable_pages', false); // Determine if protection is enabled globally for this post type $is_globally_protected = (is_page($post) && $global_pages_protection) || (!is_page($post) && $global_posts_protection); // If individual setting is not set and global protection is enabled, // we want to show the checkbox as checked $is_protected = ($individual_protection === '') ? $is_globally_protected : ($individual_protection === '1'); ?>
ID)) { return $content; } // Check for global protection settings $global_posts_protection = get_option('aisp_protector_enable_posts', false); $global_pages_protection = get_option('aisp_protector_enable_pages', false); // Get individual post protection setting $individual_protection = get_post_meta($post->ID, '_aisp_protected', true); // Check if protection should be applied $should_protect = false; if (is_single() && ($individual_protection === '1' || $global_posts_protection)) { $should_protect = true; } elseif (is_page() && ($individual_protection === '1' || $global_pages_protection)) { $should_protect = true; } if ($should_protect) { $content = $this->apply_protection($content); } return $content; } /** * Applies protection mechanisms to the content. * * @param string $content The original content. * @return string Protected content. */ private function apply_protection($content) { // Add more robust protection mechanisms $protected_content = sprintf( '%s