AnsPress_Init::drop_blog_tables( array $tables, int $blog_id )

Description #

Deleting the table whenever a blog is deleted

Parameters #

  • $tables
    array (Required) Table names.
  • $blog_id
    int (Required) Blog ID.

Source #

File: anspress-question-answer.php

		public static function drop_blog_tables( $tables, $blog_id ) {
			if ( empty( $blog_id ) || 1 === (int) $blog_id || $blog_id !== $GLOBALS['blog_id'] ) {
				return $tables;
			}

			global $wpdb;

			$tables[] = $wpdb->prefix . 'ap_views';
			$tables[] = $wpdb->prefix . 'ap_qameta';
			$tables[] = $wpdb->prefix . 'ap_activity';
			$tables[] = $wpdb->prefix . 'ap_votes';
			return $tables;
		}

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