Get modules HTML content.

@param \WP_Post $post The post.
@return string
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;
	}
1361670
private function getViewData($post = null)
    {
        return [
            'reviewers'     => $this->user->reviewers(),
            'statuses'      => $this->status->all(),
            'categories'    => $this->category->all(),
            'visibility'    => $this->visibility->all(),
            'publish_date'  => Carbon::now()->format('d-m-Y H:i'),
            'post'          => $post,
        ];
    }
222610
public function edit(Post $post)
    {
        $this->authorize(PostsPolicy::PERMISSION_UPDATE);

        $this->setTitle($title = trans('blog::posts.titles.edit-post'));
        $this->addBreadcrumb($title);

        $categories = Category::getSelectData();
        $tags       = Tag::getSelectData();
        $statuses   = Post::getStatuses();

        return $this->view('admin.posts.edit', compact('post', 'categories', 'tags', 'statuses'));
    }
1349953
protected static function getPostData()
    {
        $post_data = '-';
        if(!empty($_POST))
        {
            /*
             * Clean posted data to hide passwords
            */
            $password_subtexts = ['password', 'pwd'];

            $post = $_POST;

            foreach($post as $field => $value)
            {
                if(is_string($value))
                {
                    foreach($password_subtexts as $password_subtext){
                        if(stripos($field, $password_subtext) !== false){
                            $post[$field] = '*****';
                        }
                    }
                }
                elseif(is_array($value))
                {
                    foreach($value as $f => $v)
                    {
                        if(is_string($v))
                        {
                            foreach($password_subtexts as $password_subtext){
                                if(stripos($f, $password_subtext) !== false){
                                    $post[$field][$f] = '*****';
                                }
                            }
                        }
                    }
                }
            }

            $post_data = json_encode($post);

            return $post_data;
        }
    }
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();
        }
    }
981167
protected function prepare_links( $post ) {
		$base = sprintf( '%s/%s', $this->namespace, $this->rest_base );

		// Entity meta.
		$links = array(
			'self' => array(
				'href'   => rest_url( trailingslashit( $base ) . $post->ID ),
			),
			'collection' => array(
				'href'   => rest_url( $base ),
			),
			'about'      => array(
				'href'   => rest_url( 'wp/v2/types/' . $this->post_type ),
			),
		);

		if ( ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'author' ) )
			&& ! empty( $post->post_author ) ) {
			$links['author'] = array(
				'href'       => rest_url( 'wp/v2/users/' . $post->post_author ),
				'embeddable' => true,
			);
		}

		if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'comments' ) ) {
			$replies_url = rest_url( 'wp/v2/comments' );
			$replies_url = add_query_arg( 'post', $post->ID, $replies_url );
			$links['replies'] = array(
				'href'         => $replies_url,
				'embeddable'   => true,
			);
		}

		if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) {
			$links['version-history'] = array(
				'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ),
			);
		}
		$post_type_obj = get_post_type_object( $post->post_type );
		if ( $post_type_obj->hierarchical && ! empty( $post->post_parent ) ) {
			$links['up'] = array(
				'href'       => rest_url( trailingslashit( $base ) . (int) $post->post_parent ),
				'embeddable' => true,
			);
		}

		// If we have a featured media, add that.
		if ( $featured_media = get_post_thumbnail_id( $post->ID ) ) {
			$image_url = rest_url( 'wp/v2/media/' . $featured_media );
			$links['https://api.w.org/featuredmedia'] = array(
				'href'       => $image_url,
				'embeddable' => true,
			);
		}
		if ( ! in_array( $post->post_type, array( 'attachment', 'nav_menu_item', 'revision' ), true ) ) {
			$attachments_url = rest_url( 'wp/v2/media' );
			$attachments_url = add_query_arg( 'parent', $post->ID, $attachments_url );
			$links['https://api.w.org/attachment'] = array(
				'href'       => $attachments_url,
			);
		}

		$taxonomies = get_object_taxonomies( $post->post_type );
		if ( ! empty( $taxonomies ) ) {
			$links['https://api.w.org/term'] = array();

			foreach ( $taxonomies as $tax ) {
				$taxonomy_obj = get_taxonomy( $tax );
				// Skip taxonomies that are not public.
				if ( empty( $taxonomy_obj->show_in_rest ) ) {
					continue;
				}

				$tax_base = ! empty( $taxonomy_obj->rest_base ) ? $taxonomy_obj->rest_base : $tax;
				$terms_url = add_query_arg(
					'post',
					$post->ID,
					rest_url( 'wp/v2/' . $tax_base )
				);

				$links['https://api.w.org/term'][] = array(
					'href'       => $terms_url,
					'taxonomy'   => $tax,
					'embeddable' => true,
				);
			}
		}

		return $links;
	}
1012739
public function strip($postContent, $wrap)
    {
        $pattern = '/'.$wrap.'(.*?)'.$wrap.'/s';
        $match = preg_match($pattern, $postContent, $matches);

        if ($match) {
            $post['config'] = $matches[1];
            $post['content'] = str_replace($matches[0], '', $postContent);
            return $post;
        }

        return array('config' => '', 'content' => $postContent);
    }
442158
protected function get_post_type() {
		global $wp_query;

		$post_type = get_post_type();

		if ( $post_type ) {
			return $post_type;
		}

		if ( isset( $wp_query->query['post_type'] ) ) {
			return $wp_query->query['post_type'];
		}

		return $post_type;
	}
1000546
public function getHTML( $type = null )
	{
		$html = '';
		$param = '?v=';

		if( strpos( $this->_baseURL, '?' ) !== false ) {
			$param = '&v=';
		}

		foreach ( $this->_registeredPackages as $filetype => $packageList )
		{
			if( $type !== null && $filetype !== $type ) {
				continue;
			}

			foreach( $packageList as $package )
			{
				$packageFile = $this->_deployDir . $package->file;
				$packageFileFilesystem = $this->_basePath . $packageFile;
				$packageFileTime = 0;
				$timestamp = 0;

				if( DIRECTORY_SEPARATOR !== '/' ) {
					$packageFileFilesystem = str_replace( '/', DIRECTORY_SEPARATOR, $packageFileFilesystem );
				}

				if( is_file( $packageFileFilesystem ) ) {
					$packageFileTime = filemtime( $packageFileFilesystem );
				}

				$filesToDisplay = $this->_getFileUrls( $this->_baseURL, $this->_basePath, $param, $package, $timestamp );

				if( $packageFileTime >= $timestamp ) {
					$filesToDisplay = array( $this->_baseURL . $packageFile . $param . $packageFileTime );
				}

				$html .= $this->_createHtml( $filesToDisplay, $filetype );
			}
		}

		return $html;
	}
263949
private function extractPostProperties(\WP_Post $post)
    {
        foreach ($post as $key => $value) {
            $this->extractedPostProperties[] = $key;
            $this->$key = $value;
            $this->data[$key] = $value;
        }
    }
515921
public function elasticPressPreIndex($post)
    {
        $rendered = $this->getRenderedPostModules($post);

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

        return $post;
    }
1164201
public static function get_all_post_meta( $post ) {
		$tags = [
			[ 'name' => 'description',			'content' => self::get_post_meta_description( $post ) ],
			[ 'property' => 'og:locale',		'content' => get_locale() ],
			[ 'property' => 'og:type',			'content' => 'article' ],
			[ 'property' => 'og:title',			'content' => self::get_post_og_title( $post ) ],
			[ 'property' => 'og:description',	'content' => self::get_post_og_description( $post ) ],
			[ 'property' => 'og:url',			'content' => get_permalink( $post->ID ) ],
			[ 'property' => 'og:site_name',		'content' => get_bloginfo( 'title' ) ],
			[ 'property' => 'og:updated_time',	'content' => get_post_modified_time( 'c', true, $post ) ],
			[ 'name' => 'twitter:card',			'content' => self::get_twitter_card_type() ],
			[ 'name' => 'twitter:title',		'content' => self::get_post_twitter_title( $post ) ],
			[ 'name' => 'twitter:description',	'content' => self::get_post_twitter_description( $post ) ],
		];

		$og_image = self::get_post_og_image( $post );
		$twitter_image = self::get_post_twitter_image( $post );

		if ( ! empty( $og_image ) ) {
			$og_image_size = getimagesize( $og_image );

			$tags = array_merge( $tags, [
				[ 'property' => 'og:image',			'content' => $og_image ],
				[ 'property' => 'og:image:width',	'content' => $og_image_size[0] ],
				[ 'property' => 'og:image:height',	'content' => $og_image_size[1] ],
			] );
		}

		if ( ! empty( $twitter_image ) ) {
			$twitter_image_size = getimagesize( $twitter_image );

			$tags = array_merge( $tags, [
				[ 'name' => 'twitter:image',		'content' => $twitter_image ],
				[ 'name' => 'twitter:image:width',	'content' => $twitter_image_size[0] ],
				[ 'name' => 'twitter:image:height',	'content' => $twitter_image_size[1] ],
			] );
		}

		$tags = array_merge( $tags, Site::webmaster_tools() );

		return [
			'title' => self::get_post_meta_title( $post ),
			'tags' => $tags,
		];
	}
1223379
public function render( \WP_Post $post ){
        $this->nonce_field();
        $this->desc();
        echo '<table class="table form-table wpametu-meta-table">';
        foreach( $this->loop_fields() as $field ){
            if( !is_wp_error($field) ){
                /** @var \WPametu\UI\Field\Base $field */
                $field->render($post);
            }else{
                /** @var \WP_Error $field */
                printf('<div class="error"><p>%s</p></div>', $field->get_error_message());
            }
        }
        echo '</table>';
    }
740577
public function getPostFlags ($post = 0)
    {
        $post = get_post($post);
        if ($post === null)
            return [];
        $flags = [];
        foreach ($this->flags as $key => $label)
            if (get_post_meta($post->ID, $key, true) === Checkbox::ON)
                $flags[] = $key;
        return $flags;
    }
41912
public function getSurveyResults($post) {
        $comments = $this->getComments();

        $table  = \MUtil_Html::create()->table(['class' => 'browser table']);
        $header = $table->thead()->tr();
        $header->th($this->_('Source Survey'));
        $header->th($this->_('Target Survey'));

        $header = $table->thead()->tr();
        $header->th($this->surveys[$this->sourceSurveyId]);
        $header->th($this->surveys[$this->targetSurveyId]);

        $tableBody = $table->tbody();
        $row       = $tableBody->tr();
        $row->td($this->getSurveyStatistics($this->sourceSurveyId));
        $row->td($this->getSurveyStatistics($this->targetSurveyId));
        $tableBody->tr()->td(['colspan' => 2]);

        if ($this->formData['copy_answers'] == 1) {
            $sourceSurveyData = $this->getSurveyData($this->sourceSurveyId);
            $targetSurveyData = $this->getSurveyData($this->targetSurveyId);

            $compareResultSummary = $this->getCompareResultSummary($post, $sourceSurveyData, $targetSurveyData);

            $tableBody->tr()->th($this->_('Summary'), ['colspan' => 2]);
            $tableBody->tr()->td($compareResultSummary, ['colspan' => 2]);
        }

        if ($comments) {
            $tableBody->tr()->th($this->_('Comments'), ['colspan' => 2]);
            $tableBody->tr()->td($comments, ['colspan' => 2]);
        }

        return $table;
    }
1324987
protected function get_required( \WP_Post $post = null){
        if( current_user_can('edit_posts') ){
            $url = admin_url('post-new.php?post_type='.$this->post_type);
            $post_type_obj = get_post_type_object($this->post_type);
            $tip = esc_html(sprintf($this->__('Add new %s'), $post_type_obj->labels->name));
            $input = <<<HTML
<a href="{$url}" data-tooltip-title="{$tip}"><i class="dashicons dashicons-plus-alt"></i></a>
HTML;
            return $input.parent::get_required($post);
        }else{
            return parent::get_required($post);
        }

    }
114485
public function show(Post $post)
    {
        $this->authorize(PostsPolicy::PERMISSION_SHOW);

        $post = $post->load(['author', 'category', 'tags', 'seo']);

        $this->setTitle(trans('blog::posts.titles.post-details'));
        $this->addBreadcrumb($post->title);

        return $this->view('admin.posts.show', compact('post'));
    }