@param Post  $post
@param array $options

@return array - Check if post content is truncated
343415
private function isAbstract(Post $post, array $options = [])
    {
        if (isset($options['abstract']) && $options['abstract']) {
            if ($post->getAbstract() !== $post->getContent()) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
986793
public function getTerms(Post $post, $taxonomy)
    {
        $model = App::make(TaxonomyModel::class);

        return $model->make($taxonomy)->postTerms($post);
    }
580041
public function postTerms(Post $post)
    {
        $adaptees = wp_get_post_terms($post->id, $this->getSlug());

        return $this->plugger
            ->setModel($this)
            ->setAdapter(Term::class)
            ->plugIn($adaptees)
            ->getConnected();
    }
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);
    }
793961
public function columnFieldsMetaBoxContent($post, $args)
    {
        $fields = $args['args'][0];
        $fieldValues = get_post_meta($post->ID, 'modularity-mod-posts-expandable-list', true);

        foreach ($fields as $field) {
            $fieldSlug = sanitize_title($field);
            $value = isset($fieldValues[$fieldSlug]) && !empty($fieldValues[$fieldSlug]) ? $fieldValues[$fieldSlug] : '';
            echo '
                <p>
                    <label for="mod-' . $fieldSlug . '">' . $field . ':</label>
                    <input value="' . $value . '" class="widefat" type="text" name="modularity-mod-posts-expandable-list[' . sanitize_title($field) . ']" id="mod-' . sanitize_title($field) . '">
                </p>
            ';
        }

        echo wp_nonce_field('save_columns', 'modularity_post_columns');
    }
374972
public function callback($post, $args)
    {
        // If autosave...
        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
            return isset($post->ID) ? $post->ID : null;
        }

        // Get field
        $fields = isset($args['args']) ? $args['args'] : null;

        // Check if fields are defined
        if (!$fields || empty($fields)) {
            throw new MetaboxException(Translate::t('metabox.errors.no_type_is_defined'));
        }

        $vars = [];

        // Display fields
        foreach ($fields as $field) {
            if (!$field) {
                continue;
            }

            $vars['fields'][] = $field->render([], [
                'template' => 'metabox',
                'post' => $post,
            ], false);
        }

        // Render view
        Render::view('metabox.html.twig', $vars, 'metabox');

        // Return post if it is asked
        return isset($post->ID) ? $post->ID : null;
    }
263949
private function extractPostProperties(\WP_Post $post)
    {
        foreach ($post as $key => $value) {
            $this->extractedPostProperties[] = $key;
            $this->$key = $value;
            $this->data[$key] = $value;
        }
    }
364445
public function checkLimit(array $options)
    {
        $options['limit'] = (int)$options['limit'];
        if (empty($options['limit']) || $options['limit'] < 1) {
            $options['limit'] = 1;
        }
        $options['limit'] = max(min($options['limit'], $options['maxLimit']), 1);

        return $options;
    }
821618
public function minLength(array $options) {
        if ($options['value'] && strlen($this->elementData) >= $options['value'])
            return true;

        $this->addError($this->checkMessage('Length must not be less than ' . $options['value'], $options));
        return false;
    }
465752
protected static function get_post_area(\stdClass $post) : Array {
        $parts = [
            $post->created,
            $post->subject,
            $post->id,
        ];
        $area[] = implode('-', $parts);

        return $area;
    }
177178
public static function post(string $url, array $options = []) : array {
		$result = [
			'success' => false,
			'error' => [],
			'data' => null
		];
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query2($options['params']));
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$result['data'] = curl_exec($ch);
		if (!empty($options['json'])) {
			$result['data'] = json_decode($result['data'], true);
		}
		curl_close($ch);
		$result['success'] = true;
		return $result;
	}
460499
public function page(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validatePage();
        $this->validateBool('status');
        $this->validateBool('blog_post');
        $this->validateTitle();
        $this->validateDescriptionPage();
        $this->validateMetaTitle();
        $this->validateMetaDescription();
        $this->validateTranslation();
        $this->validateStoreId();
        $this->validateCategoryPage();
        $this->validateUserId(false);
        $this->validateImages();
        $this->validateAlias();
        $this->validateUploadImages('page');

        $this->unsetSubmitted('update');

        return $this->getResult();
    }
472175
private function is_current_post_flexible( $post, $more ) {
		return $post instanceof \WP_Post && function_exists( 'get_field' ) && ( $more || is_search() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) && ! post_password_required( $post );
	}
380795
public function getTermsForPost(AbstractPost $post)
    {
        $terms = array();

        if ($dbTerms = get_the_terms($post->getId(), $this->getName())) {
            foreach ($dbTerms as $termData) {
                $terms[] = $this->termFactory->create($termData, $this);
            }
        }

        return $terms;
    }
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;
    }
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;
	}
1221999
public function truncate(array $options): bool
    {
        $options = array_replace($this->defaultOptions, $options);
        $nItems = [];
        foreach (array_reverse($this->props['items']) as $item) {
            $f = $this->filterItem($item, $options);
            if ($f) {
                if ($f !== self::FILTER_LEFT) {
                    $nItems[] = $item;
                }
                $this->props['items'] = array_reverse($nItems);
                return true;
            }
            $nItems[] = $item;
        }
        return false;
    }