File: /var/www/html/wp-content/mu-plugins/ethnic-terms-conditions-page.php
<?php
/**
* Plugin Name: Ethnic Terms and Conditions Page
* Description: Creates and renders a plain text Terms & Conditions page.
* Version: 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! function_exists( 'ethnic_terms_conditions_page_get_target_page' ) ) {
function ethnic_terms_conditions_page_get_target_page() {
return get_page_by_path( 'terms-and-conditions' );
}
}
if ( ! function_exists( 'ethnic_terms_conditions_page_ensure_page' ) ) {
function ethnic_terms_conditions_page_ensure_page() {
$page = ethnic_terms_conditions_page_get_target_page();
if ( $page instanceof WP_Post ) {
return;
}
$page_id = wp_insert_post(
array(
'post_title' => 'Terms & Conditions',
'post_name' => 'terms-and-conditions',
'post_status' => 'publish',
'post_type' => 'page',
'post_content' => '',
'post_parent' => 0,
'comment_status' => 'closed',
)
);
if ( $page_id && ! is_wp_error( $page_id ) ) {
update_post_meta( $page_id, '_wp_page_template', 'default' );
}
}
add_action( 'init', 'ethnic_terms_conditions_page_ensure_page', 5 );
}
if ( ! function_exists( 'ethnic_terms_conditions_page_request_matches' ) ) {
function ethnic_terms_conditions_page_request_matches() {
if ( is_admin() ) {
return false;
}
$request_uri = isset( $_SERVER['REQUEST_URI'] ) ? (string) wp_unslash( $_SERVER['REQUEST_URI'] ) : '';
$request_uri = wp_parse_url( $request_uri, PHP_URL_PATH );
$request_uri = is_string( $request_uri ) ? untrailingslashit( $request_uri ) : '';
$target_path = wp_parse_url( home_url( '/terms-and-conditions/' ), PHP_URL_PATH );
$target_path = is_string( $target_path ) ? untrailingslashit( $target_path ) : '/terms-and-conditions';
return '' !== $request_uri && $request_uri === $target_path;
}
}
if ( ! function_exists( 'ethnic_terms_conditions_page_is_target' ) ) {
function ethnic_terms_conditions_page_is_target() {
if ( ethnic_terms_conditions_page_request_matches() ) {
return true;
}
if ( is_admin() ) {
return false;
}
$page = ethnic_terms_conditions_page_get_target_page();
if ( ! ( $page instanceof WP_Post ) ) {
return false;
}
return (int) get_queried_object_id() === (int) $page->ID || is_page( (int) $page->ID );
}
}
if ( ! function_exists( 'ethnic_terms_conditions_page_body_class' ) ) {
function ethnic_terms_conditions_page_body_class( $classes ) {
if ( ethnic_terms_conditions_page_is_target() ) {
$classes[] = 'ethnic-terms-conditions-active';
}
return $classes;
}
add_filter( 'body_class', 'ethnic_terms_conditions_page_body_class' );
}
if ( ! function_exists( 'ethnic_terms_conditions_page_data' ) ) {
function ethnic_terms_conditions_page_data() {
static $data = null;
if ( null !== $data ) {
return $data;
}
$data = array(
'meta_title' => 'Terms & Conditions | Ethnic Infotech',
'meta_description' => 'Read our Terms & Conditions to understand website usage rules, intellectual property, disclaimers, limitations of liability, account responsibilities, and general legal terms.',
'contact_url' => 'https://ethnicinfotech.com/contact-us/',
);
return $data;
}
}
if ( ! function_exists( 'ethnic_terms_conditions_page_render_content' ) ) {
function ethnic_terms_conditions_page_render_content() {
$data = ethnic_terms_conditions_page_data();
$contact_url = isset( $data['contact_url'] ) ? (string) $data['contact_url'] : home_url( '/contact-us/' );
ob_start();
?>
<div class="ethnic-terms-conditions">
<div class="ethnic-terms-conditions__inner">
<h1>Terms & Conditions</h1>
<p><strong>Effective Date:</strong> 16th May 2026</p>
<p>These Terms & Conditions govern use of this website and related services, interactions, and website features. By using this website, users agree to the terms described below in connection with browsing, inquiries, downloads, account activity, and other interactions with the site.</p>
<h2>1. Acceptance of Terms</h2>
<p>By accessing or using the website, users agree to these Terms & Conditions. If a user does not agree with these terms, that user should not use the website.</p>
<p>These terms may apply to general browsing, proposal requests, contact inquiries, downloads, login activity, and other interactions made through the website.</p>
<h2>2. Use of the Website</h2>
<p>Users may use the website for lawful business and informational purposes only. Users must not misuse the website or attempt to interfere with its operation.</p>
<ul>
<li>Users must not attempt unauthorized access to the website, its systems, or related services.</li>
<li>Users must not submit false, misleading, unlawful, or inappropriate information.</li>
<li>Users must not copy, scrape, disrupt, damage, reverse engineer, exploit, or otherwise use the website in unauthorized ways.</li>
<li>Users must not introduce harmful code, malicious activity, or conduct that could affect website performance, availability, or security.</li>
</ul>
<h2>3. Services and Information</h2>
<p>Content on the website is provided for general information about the company, its services, industries, resources, and capabilities. Website content is intended to support understanding of the business and its offerings, but it does not automatically create a client, vendor, or advisory relationship.</p>
<p>Submitting an inquiry, proposal request, contact form, or similar communication does not guarantee acceptance of a project, engagement, or business relationship unless separately agreed in writing.</p>
<h2>4. Intellectual Property</h2>
<p>The website content, text, branding, graphics, logos, layouts, downloadable materials, and other site elements are owned by the company or used with appropriate rights unless otherwise stated.</p>
<p>Users may not copy, reproduce, distribute, modify, republish, transmit, or commercially use website content without prior permission. Limited personal or internal business viewing is allowed only for normal and lawful use of the website.</p>
<h2>5. User Submissions</h2>
<p>If users submit information through forms, inquiries, proposal requests, uploads, or other interactions, they are responsible for ensuring that the material they provide is lawful, accurate, and appropriate to share.</p>
<p>Users should not upload or submit content, documents, or files that they do not have the right to provide. Submitted information may be used by the company for communication, evaluation of requests, service-related follow-up, operational review, and related business purposes.</p>
<h2>6. Account and Login Responsibilities</h2>
<p>Where login, account, or restricted-access functionality is available, users are responsible for maintaining the confidentiality of their credentials and for activity carried out through their account.</p>
<p>The company may suspend, restrict, or review access where misuse, unauthorized activity, security concerns, or suspected violations of these terms arise.</p>
<h2>7. Third-Party Links and Tools</h2>
<p>The website may include links to third-party websites, platforms, tools, or embedded services. These may be provided for convenience, operational support, analytics, scheduling, or related functionality.</p>
<p>The company is not responsible for the content, availability, security, or practices of third-party websites or services. Use of those third-party services is subject to their own terms, conditions, and policies.</p>
<h2>8. Disclaimer of Warranties</h2>
<p>The website and its content are provided on an “as is” and “as available” basis. While reasonable efforts may be made to keep information useful and current, the company does not guarantee that the website will always be uninterrupted, error-free, secure, available, or fully up to date.</p>
<p>The company does not guarantee that all content is complete, accurate, reliable, or suitable for every purpose, business use, or decision-making context.</p>
<h2>9. Limitation of Liability</h2>
<p>To the extent permitted by law, the company is not liable for indirect, incidental, consequential, special, or similar damages arising from or related to use of the website or reliance on website content.</p>
<p>The website is informational and operational in nature, and users access and use it at their own discretion. This section is intended to remain general and should be reviewed by legal counsel before publication.</p>
<h2>10. Indemnity</h2>
<p>Users agree not to use the website in a way that creates legal, operational, technical, or reputational harm. Users may be responsible for claims, losses, costs, or expenses resulting from misuse of the website, violation of these terms, or unlawful submissions made through the website.</p>
<h2>11. Privacy</h2>
<p>Use of the website may also be subject to the Privacy Policy. Users should review the Privacy Policy to understand how information may be collected, used, stored, and handled in connection with the website and related interactions.</p>
<h2>12. Changes to These Terms</h2>
<p>The company may update these Terms & Conditions from time to time. Updated versions may be posted on the website with a revised effective date.</p>
<p>Continued use of the website after updates may be treated as acceptance of the revised terms.</p>
<h2>13. Governing Law</h2>
<p>These Terms & Conditions are intended to be governed by the applicable laws of the relevant jurisdiction. Final governing law language, jurisdiction details, and dispute-related wording should be confirmed by legal counsel before publication.</p>
<h2>14. Contact Us</h2>
<p>If you have questions about these Terms & Conditions, please contact us using the details below:</p>
<p><strong>Company Name:</strong> Ethnic Infotech Pvt. Ltd.</p>
<p><strong>Contact Email:</strong> info@ethnicinfotech.com</p>
<p><strong>Contact Page:</strong> <a href="<?php echo esc_url( $contact_url ); ?>"><?php echo esc_html( $contact_url ); ?></a></p>
</div>
</div>
<?php
return (string) ob_get_clean();
}
}
if ( ! function_exists( 'ethnic_terms_conditions_page_filter_content' ) ) {
function ethnic_terms_conditions_page_filter_content( $content ) {
if ( ! ethnic_terms_conditions_page_is_target() || ! in_the_loop() || ! is_main_query() ) {
return $content;
}
return ethnic_terms_conditions_page_render_content();
}
add_filter( 'the_content', 'ethnic_terms_conditions_page_filter_content', 20 );
}
if ( ! function_exists( 'ethnic_terms_conditions_page_render_template_fallback' ) ) {
function ethnic_terms_conditions_page_render_template_fallback() {
if ( ! ethnic_terms_conditions_page_request_matches() ) {
return;
}
if ( ! is_404() ) {
return;
}
$page = ethnic_terms_conditions_page_get_target_page();
if ( ! ( $page instanceof WP_Post ) ) {
ethnic_terms_conditions_page_ensure_page();
$page = ethnic_terms_conditions_page_get_target_page();
}
global $wp_query, $post;
if ( $page instanceof WP_Post ) {
$post = $page;
setup_postdata( $post );
}
if ( $wp_query instanceof WP_Query ) {
$wp_query->is_404 = false;
$wp_query->is_page = true;
$wp_query->is_singular = true;
$wp_query->is_home = false;
$wp_query->is_archive = false;
$wp_query->queried_object = $page instanceof WP_Post ? $page : null;
$wp_query->queried_object_id = $page instanceof WP_Post ? (int) $page->ID : 0;
$wp_query->post = $page instanceof WP_Post ? $page : null;
$wp_query->posts = $page instanceof WP_Post ? array( $page ) : array();
$wp_query->post_count = $page instanceof WP_Post ? 1 : 0;
$wp_query->found_posts = $page instanceof WP_Post ? 1 : 0;
$wp_query->max_num_pages = 1;
}
status_header( 200 );
get_header();
echo ethnic_terms_conditions_page_render_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
get_footer();
exit;
}
add_action( 'template_redirect', 'ethnic_terms_conditions_page_render_template_fallback', 1 );
}
if ( ! function_exists( 'ethnic_terms_conditions_page_document_title' ) ) {
function ethnic_terms_conditions_page_document_title( $title ) {
if ( ! ethnic_terms_conditions_page_is_target() ) {
return $title;
}
$data = ethnic_terms_conditions_page_data();
$custom_title = isset( $data['meta_title'] ) ? trim( (string) $data['meta_title'] ) : '';
if ( '' !== $custom_title ) {
return $custom_title;
}
return $title;
}
add_filter( 'pre_get_document_title', 'ethnic_terms_conditions_page_document_title' );
}
if ( ! function_exists( 'ethnic_terms_conditions_page_head' ) ) {
function ethnic_terms_conditions_page_head() {
if ( ! ethnic_terms_conditions_page_is_target() ) {
return;
}
$data = ethnic_terms_conditions_page_data();
$meta = isset( $data['meta_description'] ) ? trim( (string) $data['meta_description'] ) : '';
if ( '' !== $meta ) {
echo '<meta name="description" content="' . esc_attr( $meta ) . '">' . "\n";
}
?>
<style id="ethnic-terms-conditions-page">
body.ethnic-terms-conditions-active #page-title.page-title-block.custom-page-title {
display: none !important;
}
body.ethnic-terms-conditions-active #main,
body.ethnic-terms-conditions-active .block-content,
body.ethnic-terms-conditions-active .fullwidth-content {
background: transparent !important;
}
.ethnic-terms-conditions {
max-width: 880px;
margin: 0 auto;
padding: 48px 20px 72px;
color: #18212c;
}
.ethnic-terms-conditions__inner {
max-width: 100%;
}
.ethnic-terms-conditions h1,
.ethnic-terms-conditions h2,
.ethnic-terms-conditions h3 {
margin: 0;
color: #18212c;
}
.ethnic-terms-conditions h1 {
font-size: clamp(34px, 4vw, 48px);
line-height: 1.08;
letter-spacing: -0.04em;
margin-bottom: 18px;
}
.ethnic-terms-conditions h2 {
font-size: clamp(24px, 2.4vw, 30px);
line-height: 1.2;
letter-spacing: -0.03em;
margin-top: 40px;
margin-bottom: 16px;
}
.ethnic-terms-conditions h3 {
font-size: 18px;
line-height: 1.35;
margin-top: 22px;
margin-bottom: 10px;
}
.ethnic-terms-conditions p,
.ethnic-terms-conditions li {
font-size: 16px;
line-height: 1.8;
color: #425066;
}
.ethnic-terms-conditions p {
margin: 0 0 16px;
}
.ethnic-terms-conditions ul {
margin: 0 0 18px 20px;
padding: 0;
}
.ethnic-terms-conditions li {
margin: 0 0 8px;
}
.ethnic-terms-conditions a {
color: #2f6bff;
text-decoration: underline;
}
.ethnic-terms-conditions strong {
color: #18212c;
}
@media (max-width: 767px) {
.ethnic-terms-conditions {
padding: 36px 18px 56px;
}
.ethnic-terms-conditions h2 {
margin-top: 32px;
}
}
</style>
<?php
}
add_action( 'wp_head', 'ethnic_terms_conditions_page_head', 20 );
}