SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > content-control > inc > functions


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/content-control/inc/functions

NameTypeSizeLast ModifiedActions
back-compat.php File 4300 bytes October 01 2023 13:39:02.
compatibility.php File 6294 bytes June 21 2024 13:00:36.
content.php File 3218 bytes October 26 2023 13:40:28.
developers.php File 10976 bytes June 21 2024 13:00:36.
globals.php File 1889 bytes June 21 2024 13:00:36.
install.php File 2216 bytes March 11 2025 14:19:36.
options.php File 4105 bytes August 18 2024 09:36:48.
post-restrictions.php File 900 bytes June 21 2024 13:00:36.
protections.php File 2250 bytes September 18 2023 05:47:10.
query.php File 13898 bytes March 15 2025 12:03:42.
restrictions.php File 6168 bytes June 21 2024 13:00:36.
rule-callbacks.php File 20563 bytes May 09 2025 02:30:24.
rules.php File 2539 bytes May 09 2025 02:30:24.
term-restrictions.php File 905 bytes June 21 2024 13:00:36.
upgrades.php File 4835 bytes December 08 2023 15:26:30.
utils.php File 584 bytes March 18 2024 03:33:26.
widgets.php File 1454 bytes December 08 2023 15:26:30.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/content-control/inc/functions/protections.php

<?php
/**
 * Option functions.
 *
 * @package ContentControl
 */

namespace ContentControl;

/**
 * Redirect to the appropriate location.
 *
 * @param string $type login|home|custom.
 * @param string $url  Custom URL.
 *
 * @return void
 */
function redirect( $type = 'login', $url = null ) {
	switch ( $type ) {
		case 'login':
			$url = wp_login_url( \ContentControl\get_current_page_url() );
			break;

		case 'home':
			$url = home_url();
			break;

		default:
		case 'custom':
			add_filter( 'allowed_redirect_hosts', function ( $hosts ) use ( $url ) {
				$hosts[] = wp_parse_url( $url, PHP_URL_HOST );

				return $hosts;
			} );
	}

	if ( $url ) {
		wp_safe_redirect( $url );
		exit;
	}
}

/**
 * Set the query to the page with the specified ID.
 *
 * @param int       $page_id Page ID.
 * @param \WP_Query $query   Query object.
 * @return void
 */
function set_query_to_page( $page_id, $query = null ) {
	if ( ! $page_id ) {
		return;
	}

	if ( ! $query ) {
		$query = get_current_wp_query();
	}

	// Create a new custom query for the specific page.
	$args = [
		'page_id'             => $page_id,
		'post_type'           => 'page',
		'posts_per_page'      => 1,
		// Used to bypass the restrictions and not add processing to the new query.
		'ignore_restrictions' => true,
	];

	$custom_query = new \WP_Query( $args );

	if ( ! $custom_query->have_posts() ) {
		return;
	}

	$query->init(); // Reset the main query.
	$query->query_vars = $args;

	// phpcs:disable:Squiz.PHP.CommentedOutCode.Found
	// $query->queried_object    = $custom_query->post;
	// $query->queried_object_id = $page_id;
	// $query->post              = $custom_query->post;
	// $query->posts             = $custom_query->posts;
	// $query->query             = $custom_query->query;

	// // Since init, only override defaults as needed to emulate page.
	// $query->is_page       = true;
	// $query->is_singular   = true;
	// $query->found_posts   = 1;
	// $query->post_count    = 1;
	// $query->max_num_pages = 1;

	// // Suppress filters. Might not need this.
	// $query->set( 'suppress_filters', true );
	// phpcs:enable:Squiz.PHP.CommentedOutCode.Found

	// Ensure all query vars are set.
	$query->get_posts();

	// Reset the post data.
	$query->reset_postdata();
}

SILENT KILLER Tool