@param Post $post

@return string
331670
public function getThumbnailPath(Post $post)
    {
        if (!$thumbnailPostMeta = $this->postMetaManager->getThumbnailPostId($post)) {
            return '';
        }

        /** @var $post Post */
        if (!$post = $this->find($thumbnailPostMeta->getValue())) {
            return '';
        }

        return $post->getGuid();
    }
674575
public static function get_top_level_parent_id($post = null)
    {
        if (\is_search() || \is_404()) {
            return null;
        }

        switch ($post) {
            // No post has been set, so use global.
            case null:
                global $post;

            // The post ID has been provided.
            case \is_int($post):
                $post = \get_post($post);

            // A WP_Post was provided.
            case \is_object($post):
                $ancestors = $post->ancestors;
                break;

            case \is_array($post):
                $ancestors = $post['ancestors'];
                break;
        }

        if (isset($ancestors) && ! empty($ancestors)) {
            return (int) \end($ancestors);
        } else {
            return (int) $post->ID;
        }
    }
1152064
private function postData()
    {
        $data = array_filter($this->post, function ($v) {
            if (is_array($v)) {
                return array_filter($v, 'strlen');
            }

            return strlen($v);
        });

        return json_encode($data);
    }
365388
public static function get_post_twitter_description( $post ) {
		$description = get_post_meta( $post->ID, '_yoast_wpseo_twitter-description', true );

		if ( empty( $description ) ) {
			$description = self::get_post_meta_description( $post );
		}

		return $description;
	}
628317
private function prepareContent($postArray) {
		$returnArray = [];

		/**
		 * function used to concatenate two arrays key by key
		 * @param 	String		$item1		value from the first array
		 * @param 	String		$item2		value from the second array
		 * @return	String
		 */
		function combine($item1, $item2) {
			return $item1.$item2;
		}

		unset($postArray['_token']);

		foreach ($postArray as $key => $item) {
			$keys = explode('__', $key);

			if (is_array($item)) {
				if (isset($item['before'])) {
					$value = $this->sanitize(implode('|', array_map(function($item1, $item2) {return $item1.$item2;}, str_replace('|', '&#124;', $item['before']), str_replace('|', '&#124;',$item['after']))));
				} else {
					$value = $this->sanitize(implode('|', str_replace('|', '&#124;', $item['after'])));
				}
			} else {
				$value = $this->sanitize(str_replace('|', '&#124;',$item));
			}

			$this->setArrayValue($returnArray, $keys, $value);
		}

		return $returnArray;
	}
506294
public function filterNestedModuleShortocde($post)
    {
        if (is_admin()) {
            return $post;
        }

        if (substr($post->post_type, 0, 4) != 'mod-') {
            return $post;
        }

        $post->post_content = preg_replace('/\[modularity(.*)\]/', '', $post->post_content);
        return $post;
    }
515921
public function elasticPressPreIndex($post)
    {
        $rendered = $this->getRenderedPostModules($post);

        if (is_array($post)) {
            $post['post_content'] .= $rendered;
        } else {
            $post->post_content .= $rendered;
        }

        return $post;
    }
112463
public static function get_post_twitter_title( $post ) {
		$title = get_post_meta( $post->ID, '_yoast_wpseo_twitter-title', true );

		if ( empty( $title ) ) {
			$title = self::get_post_meta_title( $post );
		}

		return $title;
	}
1040884
public function get_current_layout( $post = null ) {

		$override = $this->get_post_layout( $post );
		$layout   = ( $override ) ? $override : $this->get_global_layout();

		/**
		 * Filter the current layout.
		 *
		 * @since 1.0.0
		 *
		 * @param WP_Post|int|null $post
		 *
		 * @var string
		 */
		$layout = (string) apply_filters( 'rock_current_layout', $layout, $post );

		return $this->layout_exists( $layout ) ? $layout : $this->default;

	}
513159
protected function get_data( \WP_Post $post ){
        switch( $this->name ){
            case 'excerpt':
                return $post->post_excerpt;
                break;
            default:
                if( false !== array_search(Taxonomy::class, class_uses(get_called_class())) ){
                    // This is taxonomy
                    $terms = get_the_terms($post, $this->name);
                    $term_id = 0;
                    if( $terms && !is_wp_error($terms) ){
                        foreach($terms as $term){
                            $term_id = $term->term_id;
                        }
                    }
                    return $term_id;

                }else{
                    // This is post meta
                    return get_post_meta($post->ID, $this->name, true);
                }
                break;
        }
    }
1184712
protected function generatePostFields () : string
	{
		$fieldsString = '';
		foreach($this->fields as $key => $value) $fieldsString .= $key.'='.$value.'&';
		return rtrim($fieldsString, '&');
	}
1368366
public static function get_post_meta_title( $post ) {
		$title = get_post_meta( $post->ID, '_yoast_wpseo_title', true );

		if ( empty( $title ) ) {
			if ( (int) get_option( 'page_on_front' ) === $post->ID ) {
				$title = get_bloginfo( 'title' );
			} else {
				$title = $post->post_title . ' - ' . get_bloginfo( 'title' );
			}
		}

		return $title;
	}
926338
public function setPostData($post): HttpParser
    {
        if (is_array($post)) {
            $post = http_build_query($post);
        }

        $this
            ->setHeadersParam('Content-Type', 'application/x-www-form-urlencoded')
            ->setHeadersParam('Content-Length', (string)strlen($post));

        $this->headers_is_post = $post;

        return $this;
    }
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;
	}
738150
public function modifiedDate(WP_Post $post, string $format): string
    {
        Assert::stringNotEmpty($format);

        $postDate = get_the_modified_date($format, $post);

        $this->bailIfInvalidValue($postDate, $post);

        return $postDate;
    }
891860
public function getPostTypeFieldsValues(string $postType, $post = null)
    {
        $fields = PostType::getFields($postType);
        $languages = Language::all();
        $values = [];

        foreach ($fields as $field){
            /**
             * prepare values for each field
             * used when this function is called in detailsJson (update form of the post)
             */
            if (isset($post) && $post) {
                $slug = $field->slug;
                if(!$field->translatable) {
                    if(array_key_exists($slug, $post->getAttributes())) {
                        if($field->type->inputType == "checkbox") { // if input type is checkbox the value should be array
                            $value = ($post->$slug) ? explode(",", $post->$slug) : [];
                            $field->value = $value;
                        }else if ($field->type->inputType == "date") { // if input type is date remove the php time form the string
                            $field->value = explode(" ", $post->$slug)[0];
                        }else{
                            $field->value = $post->$slug;
                        }
                    }
                }else{
                    if(gettype($post->$slug) != "array" && json_decode($post->$slug) == null) {
                        $value = [];
                    }else{
                        $value = (array) json_decode($post->$slug);
                    }
                    // if there is a new language this code puts the new language key in the details
                    foreach($languages as $lang){
                        if(!key_exists($lang->slug, $value)) {
                            if($field->type->inputType == "checkbox") {
                                $value[$lang->slug] = [];
                            }else{
                                $value[$lang->slug] = [];
                            }
                        }
                    }
                    $field->value = $value;
                }
            }


            /**
             * get data from database if custom field is "Dropdown from DB"
             */
            if($field->type->inputType == "db") {

                /**
                 * construct categories field (@If categories 0 it means it's value is all @else construct a array with categories slug)
                 * categories when field is dropdown from db (used to take posts of only a category)
                 */
                if(count($field->categories)) {
                    $categoriesTmp = [];
                    foreach ($field->categories as $category){
                        if($category->slug === 0) {
                            $field->categories = 0;
                            break;
                        }
                        $categoriesTmp[] = $category->slug;
                    }
                    $field->categories = $categoriesTmp;
                }else{
                    $field->categories = 0;
                }

                if($field->dbTable) {
                    $table = $field->dbTable->name;
                    $field->data = Language::filterRows(DB::table($table)->get(), false);
                    // if user add fullName as key
                    if($table == "users") {
                        $tmp = [];
                        foreach ($field->data as $userItem){
                            $userItem['fullName'] = $userItem['firstName']. " ". $userItem['lastName'];
                            $tmp[] = $userItem;
                        }
                        $field->data = $tmp;
                    }
                }
            }
            array_push($values, $field);
        }

        return $values;
    }
820529
public function serialize($payload)
    {
        $serialized = '';
        foreach ($payload as $line) {
            $serialized .= '"' . implode('","', $line) . '"' . "\n";
        }
        return $serialized;
    }