Required_Page::filter_content( int $post_id, string $content )

Summary

Add page shortcode to the content if missing


Parameters

$post_id

(int) (Required) Post id

$content

(string) (Required) Post content


Return

(string) The content of the post


Source

File: src/BigCommerce/Pages/Required_Page.php

	public function filter_content( $post_id, $content ) {
		if ( $this->get_post_id() === $post_id ) {
			$shortcode = $this->get_content();
			if ( strpos( $content, $shortcode ) === false ) {
				return $content . $shortcode;
			}
		}
		return $content;
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.