acf_third_party::pts_allowed_pagespublicACF 5.0.0

pts_allowed_pages

This filter will prevent PTS from running on the field group page!

Method of the class: acf_third_party{}

No Hooks.

Returns

$pages.

Usage

$acf_third_party = new acf_third_party();
$acf_third_party->pts_allowed_pages( $pages );
$pages(required)
.

Changelog

Since 5.0.0 Introduced.

acf_third_party::pts_allowed_pages() code ACF 6.0.4

function pts_allowed_pages( $pages ) {

	// vars
	$post_type = '';

	// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Verified elsewhere.
	// check $_GET because it is too early to use functions / global vars.
	if ( ! empty( $_GET['post_type'] ) ) {

		$post_type = sanitize_text_field( $_GET['post_type'] );

	} elseif ( ! empty( $_GET['post'] ) ) {

		$post_type = get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized when get_post_type() calls get_post().

	}
	// phpcs:enable WordPress.Security.NonceVerification.Recommended
	// check post type
	if ( $post_type == 'acf-field-group' ) {

		$pages = array();

	}

	// return
	return $pages;

}