Astra_Target_Rules_Fields::get_meta_option_post( string $post_type, array $option )

Meta option post.


Description


Parameters

$post_type

(string) (Required) Post Type.

$option

(array) (Required) meta option name.


Return

(false) | object


Source

File: classes/modules/target-rule/class-astra-target-rules-fields.php

		public static function get_meta_option_post( $post_type, $option ) {
			$page_meta = ( isset( $option['page_meta'] ) && '' != $option['page_meta'] ) ? $option['page_meta'] : false;

			if ( false !== $page_meta ) {
				$current_post_id = isset( $option['current_post_id'] ) ? $option['current_post_id'] : false;
				$meta_id         = get_post_meta( $current_post_id, $option['page_meta'], true );

				if ( false !== $meta_id && '' != $meta_id ) {
					self::$current_page_data[ $post_type ][ $meta_id ] = array(
						'id'       => $meta_id,
						'location' => '',
					);

					return self::$current_page_data[ $post_type ];
				}
			}

			return false;
		}

Changelog

Changelog
Version Description
1.0.0 Introduced.


User Contributed Notes

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