• Home
  • Knowledgebase
  • DevDocs
  • Translations
  • Support
  • Live Preview

logo DevDocs

By The Events Calendar
Filter by type:
Skip to content
Filter by type:
Search
Browse: Home / Classes / Account_API / Account_API::get_account_id_in_admin()
Product: Virtual Events

Account_API::get_account_id_in_admin( int $post_id )

Get the Zoom account id in the WordPress admin.

Contents

  • Parameters
  • Return
  • Source
  • Changelog

Parameters

$post_id

(int) (Required) The optional post id.


Top ↑

Return

(string) The account id or empty string if not found.


Top ↑

Source

File: src/Tribe/Meetings/Zoom/Account_API.php

	public function get_account_id_in_admin( $post_id = 0 ) {
		// If there is a post id, check if it is a post and if so use to get the account id.
		$post = $post_id ? get_post( $post_id ) : '';
		if ( $post instanceof \WP_Post ) {
			return get_post_meta( $post_id, $this->account_id_meta_field_name, true );
		}

		// Attempt to load through ajax requested variables.
		$nonce             = tribe_get_request_var( '_ajax_nonce' );
		$zoom_account_id   = tribe_get_request_var( 'zoom_account_id' );
		$requested_post_id = tribe_get_request_var( 'post_id' );
		if ( $zoom_account_id && $requested_post_id && $nonce ) {

			// Verify the nonce is valid.
			$valid_nonce = $this->is_valid_nonce( $nonce );
			if ( ! $valid_nonce ) {
				return '';
			}
			// Verify there is a real post.
			$post = get_post( $post_id );
			if ( $post instanceof \WP_Post ) {
				return esc_html( $zoom_account_id );
			}
		}

		// Safety check.
		if ( ! function_exists( 'get_current_screen' ) ) {
			return '';
		}

		// Set the ID if on the single event editor.
		if ( ! $post_id ) {
			$screen = get_current_screen();
			if ( ! empty( $screen->id ) && $screen->id == TEC::POSTTYPE ) {
				global $post;
				$post_id = $post->ID;
			}
		}

		if ( ! $post_id ) {
			return '';
		}

		return esc_html( get_post_meta( $post_id, $this->account_id_meta_field_name, true ) );
	}

Expand full source code Collapse full source code


Top ↑

Changelog

Changelog
Version Description
1.5.0 Introduced.
The Events Calendar
  • Home
  • Products
  • Blog
  • Support
© 2026 The Events Calendar Terms and Conditions Privacy