array( 'embed_form' => array( 'endpoints' => $this->get_endpoints(), ), ), ); } /** * Get the various endpoints for the Embed UI. * * @since 2.6 * * @return array */ private function get_endpoints() { return array( // Endpoint to get posts for typeahead 'get_posts' => array( 'action' => array( 'value' => 'gf_embed_query_posts', 'default' => 'mock_endpoint', ), 'nonce' => array( 'value' => wp_create_nonce( GF_Embed_Endpoint_Get_Posts::ACTION_NAME ), 'default' => 'nonce', ) ), // Endpoint to create a new page with our block inserted. 'create_post_with_block' => array( 'action' => array( 'value' => GF_Embed_Endpoint_Create_With_Block::ACTION_NAME, 'default' => 'mock_endpoint', ), 'nonce' => array( 'value' => wp_create_nonce( GF_Embed_Endpoint_Create_With_Block::ACTION_NAME ), 'default' => 'nonce', ) ) ); } }