Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Previews::should_preview_popup( int $popup_id )

Sets the Popup Post Type public arg to true for content editors.


Description Description

This enables them to use the built in preview links.


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Parameters Parameters

$popup_id

(Required)


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: classes/Previews.php

	public static function should_preview_popup( $popup_id = 0 ) {
		if ( defined( "DOING_AJAX" ) && DOING_AJAX ) {
			return false;
		}


		if ( isset( $_GET['popup_preview'] ) && $_GET['popup_preview'] && isset( $_GET['popup'] ) ) {

			static $popup;

			if ( ! isset( $popup ) ) {
				if ( is_numeric( $_GET['popup'] ) && absint( $_GET['popup'] ) > 0 ) {
					$popup = absint( $_GET['popup'] );
				} else {
					$post  = get_page_by_path( sanitize_text_field( $_GET['popup'] ), OBJECT, 'popup' );
					$popup = $post->ID;
				}
			}

			if ( $popup_id == $popup && current_user_can( 'edit_post', $popup ) ) {
				return true;
			}
		}

		return false;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.