AnsPress_Admin::trashed_post( integer $post_id )

Description #

Delete page check transient after AnsPress pages are deleted.

Parameters #

  • $post_id
    integer (Required) Page ID.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: admin/anspress-admin.php

	public static function trashed_post( $post_id ) {
		$_post = get_post( $post_id );

		if ( 'page' === $_post->post_type ) {
			$pages_slug = array( 'base_page', 'ask_page' );
			$page_ids   = array();
			$opt        = ap_opt();

			foreach ( $pages_slug as $slug ) {
				$page_ids[] = $opt[ $slug ];
			}

			if ( in_array( $_post->ID, $page_ids, true ) ) {
				delete_transient( 'ap_pages_check' );
			}
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment