@param array $data
@param \WP_Post $post

@return array
760588
protected function set_post_data( $data, $post ) {
		$data['post_title'] = $post->post_title;
		$data['post']       = $post;
		if ( $this->user_can( 'read_post' ) ) {
			$data['edit_link'] = get_edit_post_link( $post->ID );
		}

		foreach ( $this->get_data_field_settings() as $k => $v ) {
			$data[ $k ] = $this->sanitize_input( $this->app->utility->array_get( $data, $k ), $v['type'] );
		}

		return $data;
	}
642485
public static function createOpenGraphTagsForPost($post) {
       return [
            'og:title'               => $post->title,
            'og:type'                => 'article',
            'og:url'                 => $post->canonical_url,
            'og:image'               => $post->urlImage,
            'og:description'         => $post->meta_description,
            'og:site_name'           => Config::get('lasallecmsfrontend.og_site_name'),
            'article:published_time' => $post->created_at,
            'article:modified_time'  => $post->updated_at,
        ];
    }
73185
protected function get_slots_in_request($postdata = null) {
        // Note: we must not use "question_attempt::get_submitted_var()" because there is no attempt instance!!!
        if (is_null($postdata)) {
            $slots = optional_param('slots', null, PARAM_SEQUENCE);
        } else if (array_key_exists('slots', $postdata)) {
            $slots = clean_param($postdata['slots'], PARAM_SEQUENCE);
        } else {
            $slots = null;
        }
        if (is_null($slots)) {
            $slots = $this->get_slots();
        } else if (!$slots) {
            $slots = array();
        } else {
            $slots = explode(',', $slots);
        }
        return $slots;
    }
31554
public function postRequest($uri, array $data = null)
    {
        return $this->getClient()->post($uri, [
            'json' => $this->createBody($data)
        ]);
    }
342460
public function post($resource, $data = [])
    {
        $exec = $this->execute(Method::$HTTP_POST, $resource, ['json' => $data]);

        return $exec;
    }
913438
private function populateWith(array $data): array
    {
        $newData = [];
        foreach ($data as $row) {
            $tmp = [];
            foreach ($row as $key => $value) {
                if (false !== strpos($key, '__')) {
                    list($prefix, $postfix) = explode('__', $key);
                    if (!isset($tmp[$prefix])) {
                        $tmp[$prefix] = [];
                    }
                    $tmp[$prefix][$postfix] = $value;
                } else {
                    $tmp[$key] = $value;
                }
            }
            $newData[] = $tmp;
        }

        return $newData;
    }
79916
protected function update_the_post( array $post_data ) {
		global $wpdb;

		if ( ! $this->exists() || empty( $post_data ) ) {
			return;
		}

		if ( doing_action( 'save_post' ) || 0 === strpos( current_action(), 'save_post' ) ) {
			$updated = $wpdb->update( $wpdb->posts, $post_data, [ 'ID' => $this->get_id() ] );
		} else {
			$updated = wp_update_post( array_merge( [ 'ID' => $this->get_id() ], $post_data ) );
		}

		clean_post_cache( $this->get_id() );

		return ( 0 !== $updated && false !== $updated );
	}
153154
private function postData()
    {
        if (empty($this->post)) {
            return;
        }

        $post = array_filter($this->post);

        return http_build_query($post);
    }
125110
public static function get_post_meta_description( $post ) {
		$description = get_post_meta( $post->ID, '_yoast_wpseo_metadesc', true );

		if ( empty( $description ) ) {
			$description = Text::trim_to_nearest_word( wp_strip_all_tags( $post->post_content ), 160 );
		}

		return $description;
	}
555626
private function get_modules_content( \WP_Post $post ) : string {
		$flexible_content = $this->_flexible_content[ $post->ID ] ?? null;

		if ( empty( $flexible_content ) ) {
			$layouts = $this->get_current_post_layouts( $post );

			foreach ( $layouts as $layout ) {

				if ( ! isset( $layout['acf_fc_layout'] ) || empty( $layout['acf_fc_layout'] ) ) {
					continue;
				}

				ob_start();
				$this->render_module_template( $layout['acf_fc_layout'], $layout );
				$flexible_content .= ob_get_clean();
			}

			/*
			 * Store the flexible content to reuse it if `the_content` is
			 * runned more than once.
			 */
			$this->_flexible_content[ $post->ID ] = $flexible_content;
		}

		return (string) $flexible_content;
	}
32982
protected function prepareAttachments(Post $post)
	{
		$attachments = array();
		$attachments['message'] = $post->getMessage();
		if($post->getLink())
		{
			$attachments['link'] = $post->getLink();
		}
		//TODO: Image web path required
		if($post->getImages())
		{
			$images = $post->getImages();
			$attachments['picture'] = array_shift($images);
		}
		return $attachments;
	}
1031319
public static function get_terms( $the_post ) {
		$taxonomies = get_object_taxonomies( $the_post );

		$post_terms = [];

		foreach ( $taxonomies as $taxonomy ) {
			$post_terms[ $taxonomy ] = [];

			$terms = wp_get_post_terms( $the_post->ID, $taxonomy );

			foreach ( $terms as $term ) {
				$post_terms[ $taxonomy ][] = [
					'id' => $term->term_id,
					'name' => $term->name,
					'slug' => $term->slug,
					'description' => $term->description,
				];
			}
		}

		return $post_terms;
	}
465752
protected static function get_post_area(\stdClass $post) : Array {
        $parts = [
            $post->created,
            $post->subject,
            $post->id,
        ];
        $area[] = implode('-', $parts);

        return $area;
    }
803351
protected function resolveBody(array $post = [])
    {
        $rest = [];

        if (in_array($this->method(), ['OPTIONS', 'HEAD', 'PUT', 'DELETE', 'TRACE'])) {
            parse_str($this->raw, $rest);
        }

        return array_merge($post, $rest);
    }
285359
public function render(\WP_Post $post, array $args)
    {
        $args = array_merge($args['args'], [
            'metabox' => $this,
            'post' => $post,
            'screen' => $this->getScreen()
        ]);

        $response = $this->handleCallback($this->getCallback(), $args);

        if ($response instanceof Renderable) {
            echo $response->render();
        } elseif ($response instanceof Response) {
            echo $response->getContent();
        }
    }
986793
public function getTerms(Post $post, $taxonomy)
    {
        $model = App::make(TaxonomyModel::class);

        return $model->make($taxonomy)->postTerms($post);
    }
952827
public function collect($post_id, string $key = ''): array
    {
        $post_id = (int) ($post_id ?? get_the_ID());

        if (!$post_id) { // Empty key is OK here.
            return []; // Not possible; empty array.
        }
        $value        = get_post_meta($post_id, $this->key($key), false);
        return $value = !is_array($value) ? [] : $value;
    }