'dicegem_category', 'hide_empty' => false, 'fields' => 'ids', ) ) as $dicegem_term_id ) { if ( is_int( $dicegem_term_id ) ) { wp_delete_term( $dicegem_term_id, 'dicegem_category' ); } } $dicegem_page_ids = get_posts( array( 'post_type' => 'dicegem_game', 'post_status' => array_keys( get_post_stati() ), 'posts_per_page' => -1, 'fields' => 'ids', 'no_found_rows' => true, ) ); foreach ( $dicegem_page_ids as $dicegem_page_id ) { $dicegem_cover_id = get_post_thumbnail_id( $dicegem_page_id ); if ( $dicegem_cover_id && get_post_meta( $dicegem_cover_id, '_dicegem_source', true ) ) { wp_delete_attachment( $dicegem_cover_id, true ); } wp_delete_post( $dicegem_page_id, true ); } foreach ( array( 'dicegem_settings', 'dicegem_catalog_backup', 'dicegem_pages', 'dicegem_pages_synced', 'dicegem_flush', 'dicegem_cover_errors', 'dicegem_activated', 'dicegem_connected' ) as $dicegem_option ) { delete_option( $dicegem_option ); } delete_transient( 'dicegem_catalog' );